## ALGORITHM:

```1.	Begin
2.	Enter a, b values.
(ii)	Print ‘- Subtraction’.
(iii)	Print ‘* Multiplication’.
(iv)	Print ‘/ Division’.
(v)	Print ‘% Remainder’.
(vi)	Print ‘E Exit’.
5.	If op==’E’ then goto step 8 otherwise follow the below steps
6.	Switch(op)
a.	case +:
ii.	c=a+b.
iii.	Print ‘Sum=’c.
iv.	break
b.	case -:
v.	Print ‘Subtraction’.
vi.	c=a-b.
vii.	Print ‘Difference=’c.
viii.	break
c.	case *:
ix.	Print ‘Multiplication’.
x.	c=a*b.
xi.	Print ‘Product=’c.
xii.	break
d.	case /:
xiii.	Print ‘Division’.
xiv.	c=a/b.
xv.	      Print ‘Quotient=’c.
xvi.	break
e.	case %:
xvii.	Print ‘Remainder’.
xviii.	c=a%b.
xix.	Print ‘Remainder=’c.
xx.	break
f.	default:
xxi.	Print ‘Invalid Option’.
xxii.	break
7.	while(1) then goto step 3.
8.	Stop.
```

## PROGRAM:

```#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
int a, b, c;
char op;
//clrscr();
printf("Enter a and b:");
scanf("%d%d",&a,&b);
do
{
printf("- Subtraction\n");
printf("* Multiplication\n");
printf("/ Division\n");
printf("%% Remainder\n");
printf("E Exit\n");
getchar();
op=getchar();
if(op=='E'||op=='e')
exit(1);
switch(op)
{
case '+':
c=a+b;
printf("Sum=%d\n",c);
break;
case '-':
printf("Subtraction\n");
c=a-b;
printf("Difference=%d\n",c);
break;
case '*':
printf("Multiplication\n");
c=a*b;
printf("Product=%d\n",c);
break;

case '/':
printf("Division\n");
c=a/b;
printf("Quotient=%d\n",c);
break;
case '%':
printf("Remainder\n");
c=a%b;
printf("Remainder=%d\n",c);
break;
default:
printf("Invalid Option\n");
break;
}	/*end of switch statement*/
}
while(1);	/*End of while*/

}/*End of main function*/
```

## OUTPUT:

```Enter a and b:10 20

- Subtraction
* Multiplication
/ Division
% Remainder
E Exit
Multiplication
Product=200

- Subtraction
* Multiplication
/ Division
% Remainder
E Exit