Calculator Operation Using Switch Case C program

Calculator Operation Using Switch Case C program

This program specially for Calculator Operation Using Switch Case C program which can do Addition,Subtractions,Multiplication,Division mathematical operations. It also has Menu to do Such Options in Simple Formats


/* Program For Addition,Subtraction,Division,Multiplication*/
#include<stdio.h>

int main()
{
int a,b,c;

while(1)
{
printf("n****Choose The Following Options****n");
printf("-Press 1 for Additionsn");
printf("-Press 2 for Subtractionsn");
printf("-Press 3 for Multiplicationn");
printf("-Press 4 for Divisionsn");
printf("-Press 5 for Exitn");
scanf("%d",&c);
if(c==5)
break;
printf("Please Enter two nos:");
scanf("%d %d",&a,&b);
switch(c)
{
case 1:printf("nAdditions is:t%d",a+b);
break;
case 2:printf("nSubtractions is:t%d",a-b);
break;
case 3:printf("nMultiplication is:t%d",a*b);
break;
case 4:printf("nDivision is:t%d",a/b);
break;
default:printf("n Invalid Choice....!n");
continue;
}
}

return 0;


}