logo
Arithmetic Operators In C Language
C Arithmetic operators are used to perform mathematical calculations like, Addition (+), Subtraction (-), Multiplication (*), Division (/), Modulo Division (%).

Modulo division produces the remainder of an integer division. During modulo division, the sign of the result is always the sign of the first operand (the dividend).
  Example :
- 14 % 3 = -2 
-14 % - 3 = 2
  Program : The following program is an example to illustrate arithmetic operations.
#include<stdio.h>
#include<conio.h>
int main()   
    {
	int a=40,b=20,add,sub,mul,div,mod;
	add=a+b;
	sub=a-b;
	mul=a*b;
	div=a/b;
	mod=a%b;
	printf(“Addition=%d”,add);
	printf(“\nSubtraction=%d”,sub);	
	printf(“\nmultiplication=%d”,mul);
	printf(“\nDivision=%d”,div);
	printf(“\nModulo Division=%d”,mod);
	getch(); 
}
Output :

Addition= 60
Subtraction= 20
Multiplication= 800
Division= 2
Modulo Division= 0