A program of simple mathematical calculator

 // A program of simple mathematical calculator



#include<stdio.h>
#include<conio.h>
main()
{int character,x,y,z;
printf("This is a calculator made by Rifat\n");
printf("for add (+) press A\n");
printf("for substract (-) press S\n");
printf("for multiple (*) press M\n");
printf("for devide (/) press D\n");
printf("now enter your choice\n");
character = getchar();
printf("enter your 1st number  : ");
scanf("%d",&x);
printf("enter your 2nd number  : ");
scanf("%d",&y);
switch(character)
{
case'A':
z=x+y;
printf("\n%d + %d = %d",x,y,z);
break;
case'S':
z=x-y;
printf("\n%d - %d = %d",x,y,z);
break;
case'M':
z=x*y;
printf("\n%d * %d = %d",x,y,z);
break;
case'D':
z=x/y;
printf("\n%d / %d = %d",x,y,z);
break;
default:

printf("you are wrong");
}
getch();

}