Division(/) and Mod(%):- '/' gives quotient and '%' gives remainder
Ex:- 10/3=3 and 10%3=1
#include<stdio.h>
void main()
{
int a, b, sum, sub, pro, div, mod;
printf("Enter two numbers:");
scanf("%d%d", &a, &b);
sum = a+b;
sub = a-b;
pro = a*b;
div = a/b;
mod = a%b;
printf("Sum= %d\nSub= %d\nPro= %d\n Div= %d\n Mod=%d", sum, sub, pro, div, mod);
}
0 Comments