how do i use a char variable in an if statement
after this I have to check whether the character is a digit or a character.
i havent been taught arrays and i cannot use #include<ctype.h>
Please tell me how to use the char variable in an if statement.
Thank you in advance.
the character a is represented as 'a', which just translates into the integer value 97.
if (a >= 'a' && a <= 'z') //if the char in variable a is between lowercase a and lowercase z
you can do the same with '0' and '9', 'A' and 'Z', etc
Last edited on
Topic archived. No new replies allowed.