DamnSchool
In " C " language we can carryout basic arithmetic operation like addition, subtraction, multiplication and division. Both unary and binary are Arithmetic Operator.

Arithmetic Operators

  Operator   Meaning   Example  
+ Addition 7 + 3 = 10
- Subtraction 10 - 3 = 7
*   Multiplication   5 * 2 = 10
/ Division 10 / 2 = 5
% Modulus 9 % 2 = 1
//  Arithmetic Operators
#include<stdio.h>
int main()
{
int X=16,Y=10,Z;
Z=X+Y;
printf("X+Y=%d\n",Z);
Z=X-Y;
printf("X-Y=%d\n",Z);
Z=X*Y;
printf("X*Y=%d\n",Z);
Z=X/Y;
printf("X/Y=%d\n",Z);
Z=X%Y;
printf("X%%Y=%d\n\b",Z); 
return 0;
}

Run Example >

< Previous Next >

Privacy Policy Terms of Service About
Creative Commons License
This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.