Write a program that reads two nos. from key board and gives their addition, subtraction, multiplication, division and modulo.

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,sub,mul,div,add,mod;
clrscr();
printf(“Enter the value of a&b”);
scanf(“%d%d”,&a,&b);
sub=a-b;
mul=a*b;
div=a/b;
add=a+b;
mod=a%b;
printf(“sub of a&b is%d”,sub);
printf(“mul of a&b is%d”,mul);
printf(“div of a&b is%d”,div);
printf(“add of a&b is%d”,add);
printf(“Module of a&b is%d”,mod);

getch();
}

Share Post