i have created a simple calc but how can i make it calculate
3^5 using switch and case... well anywayz just in case here is my code
#include <stdio.h>
#include <math.h>
int main()
{
int x,y;
char var;
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 '^':
printf("Answer = %d\n", x^y);
break;
default:
printf(" please try that again\n ");
system("./a.out");
}
}