C Program for ADD,SUB,MUL,DIV,REM
void main()
{
int a,b,c,ch=0;
clrscr();
while(ch<=5)
{
printf(" \n\n 1:- For To Add\n 2:- For To Sub\n 3:- For To Mul\n 4:- For To Div\n 5:- For To Rem\n 6:- For To Exit");
printf("\nENTER YOUR CHOICE=");
flushall();
scanf("%d",&ch);
switch(ch)
{
case 1:
printf("ENTER THE FIRST VALUE=");
flushall();
scanf("%d",&a);
printf("ENTER THE SECOND VALUE=");
flushall();
scanf("%d",&b);
c=a+b;
printf("THE SUM OF %d AND %d IS=%d",a,b,c);
break;
case 2:
printf("ENTER THE FIRST VALUE=");
flushall();
scanf("%d",&a);
printf("ENTER THE SECOND VALUE=");
flushall();
scanf("%d",&b);
c=a-b;
printf("THE SUB OF %d AND %d IS=%d",a,b,c);
break;
case 3:
printf("ENTER THE FIRST VALUE=");
flushall();
scanf("%d",&a);
printf("ENTER THE SECOND VALUE=");
flus000hall();
scanf("%d",&b);
c=a*b;
printf("THE MUL OF %d AND %d IS=%d",a,b,c);
break;
case 4:
printf("ENTER THE FIRST VALUE=");
flushall();
scanf("%d",&a);
printf("ENTER THE SECOND VALUE=");
flushall();
scanf("%d",&b);
c=a/b;
printf("THE DIV OF %d AND %d IS=%d",a,b,c);
break;
case 5:
printf("ENTER THE FIRST VALUE=");
flushall();
scanf("%d",&a);
printf("ENTER THE SECOND VALUE=");
flushall();
scanf("%d",&b);
c=a%b;
printf("THE REM OF %d AND %d IS=%d",a,b,c);
break;
}
}
getch();
}
OUTPUT :
1 FOR TO ADD.
2 FOR TO SUB.
3 FOR TO MUL.
4 FOR TO DIV.
5 FOR TO REM.
6 FOR TO EXIT
ENTER YOUR CHOICE: 1
ENTER 1 NO: 5
ENTER 2 NO: 5
THE SUM OF 5 AND 5 IS 10