Arithmetic Operators in C Programming Language
Notes:
Arithmetic Operators in C Programming Language:
+: Addition Operator : sum of two numbers
- : Subtraction Operator : difference between two numbers
*: Multiplication Operator : product of two numbers
/: Division Operator : quotient of a division operation
%: Modulus Operator : remainder of a first division operation
Example Code:
#include <stdio.h>
int main()
{
printf("%d\n",2+2); // 4
printf("%d\n",5+2); // 7
printf("%d\n",5-2); // 3
printf("%d\n",10-2); // 8
printf("%d\n",5*2); // 10
printf("%d\n",10*2); // 20
printf("%d\n",10/2); // 5
printf("%d\n",10%2); // 0
printf("%.1f\n",11/(float)2); // 5.5
printf("%d\n",11%2); // 1
return 0;
}