ok so far i have my cal calculate - ,+ ,* ,/ and ^ i want to know am i missing something ..? am i missing any featurez...? and another thing iz what if i wanted to calculate another problem how can i make the program run again...when they click on yes(y)... here is the code..
#include <stdio.h>
#include <math.h>
int main()
{
int x, y, i;
char var;
int result = 1;
printf("Type the operator +,-,/,* and your prob in this format 5+5\n");
scanf("%d%c%d",&x,&var,&y);
switch(var)
{
case '+':
printf("Answer = %d\n",x+y);
break;
case '/':
printf("Answer = %d\n", x/y);
break;
case '-':
printf("Answer = %d\n", x-y);
break;
case '*':
printf("Answer = %d\n", x*y);
break;
case '^':
{
for(i=0; i<y; i++)
result *=x;
printf("Answer = %d\n", result);
break;
default:
printf(" please try that again\n ");
}
}
}