//program to perform four arithmetic operations addition,subtraction,multiplication,division using menu.
#include
#include
void main()
{
clrscr();
int in,n1,n2;
printf("\nEnter two numbers\n");
scanf("%d%d",&n1,&n2);
clrscr();
printf("\n1.Addition\n2.Subtraction\n3.Multiplication\n4.Division\n");
scanf("%d",&in);
clrscr();
if(in==1)
{
printf("\nThe sum is %d",n1+n2);
}
if(in==2)
{
printf("\nThe difference is %d",a-b);
}
if(in==3)
{
printf("\nThe product is %d",a*b);
}
if(in==4)
{
printf("\nThe quotient is %d",a/b);
}
getch();
}
Comment below to get your required program.
0 comments:
Post a Comment