c check if char is an operator

C
char o = '+';	//Or some other character

if (o == '%' || o == '/' || o == '*' || o == '+' || o == '-') {
	//Do something
    //...
}
Source

Also in C: