Skip to main content

Example of arithmetic operator in c

 #include <stdio.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 of a, b is : %d\n", add);

printf("Subtraction of a, b is : %d\n", sub);

printf("Multiplication of a, b is : %d\n", mul);

printf("Division of a, b is : %d\n", div);

printf("Modulus of a, b is : %d\n", mod);

}

Comments