You are on page 1of 1

#include<stdio.

h>
void main()
{
int a,b,op,res;
do{
printf("\n Enter nos ");
scanf("%d %d",&a,&b);
printf("\n Select operation 1.Add 2.Sub 3.Multiply 4.Div 5.Rem ");
scanf("%d",&op);
switch(op)
{
case 1: res=a+b;break;
case 2: res=a-b;break;
case 3: res=a*b;break;
case 4: res=a/b;break;
case 5: res=a%b;break;
default: printf("\n Invalid option\n");
}
printf("\n Result after operation %d\n",res);
printf("\n Continue?(1/0)");
scanf("%d",&op);
}while(op==1);
}

You might also like