I really don't know what's the mistake. It seems to be right, doesn't it?
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
char op;
printf("Type in operator (+,-,/,*):");
scanf("%i",&op);
if(op == '+')
{
printf("You entered a plus");
}
system("pause");
return 0;
}
I expected it to print "You entered a plus" when entering a +. It does not.
I'm kinda new to C. Thanks in advance :)