Your almost there you just got an extra scanf you don't need.
remove the first one
and move the second scanf to where the first scanf was, also change the second %d to %c, You should end up with
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;
default : printf(" please try that again\n ");
break;
}
}
Now it should definatley work