Immediate or cancel is a security order type instructing that the quantity of the buy or sell order is to be executed immediately. Once entered, this type of order must be executed immediately. The order can (but does not have to) be executed in full. If it cannot be executed immediately or fully, the pending part gets canceled (a partial execution is generated) by the market.
Example. Mr. A placed a buy order for 100 scrips of Axis Bank with order type as IOC. When the order went to the exchange, order for buying only 89 shares got executed. In this case, the pending part (100-89=11 shares) will get cancelled.