Answers for "detect if char is \n c"

C
0

c check if character is a digit

char ch = '1';
if(isdigit(ch))
  printf("numeric");     
else
    printf("alphabet" );
 // output: numeric
CCopy
Posted by: Guest on April-06-2022
1

c check if char is an operator

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

if (o == '%' || o == '/' || o == '*' || o == '+' || o == '-') {
	//Do something
    //...
}
Posted by: Guest on June-09-2020

Code answers related to "C"

Browse Popular Code Answers by Language