Wednesday, December 5, 2012 #

## integer arithmetic

Integer arithmetic
When both operands are integer then the arithmetic operation with these operand is called integer arithmetic.
Ex-

Let us take two variable a and b. The value of a =17 and b=4 then the result of these operation are –

Expression                          result
a+b                                          21
a-b                                          13
a*b                                          68
a/b                                           4
a%b                                         1

after division operation the decimal   part will be truncated and result is only   integer part of quotient .after  modulus operation the result will be remainder part of integer division.

It is necessary  fo division and modulus operation that second operand must be nonzero.

1.Program to understand the integer   arithmetic operatin .

Include<stdio.h>
Void main( )
{
Int a=17,b =4;
Printf(“after subtraction :%d\n”a-b);
Printf(‘after division :%d\n”a/b);
Printf(“after modulus :%d\n”,a %d);
}
Output: