Answers for "c if given character is alphabet"

C
-2

c check if char is number

char c = 'a'; // or whatever

if (isalpha(c)) {
    puts("it's a letter");
} else if (isdigit(c)) {
    puts("it's a digit");
} else {
    puts("something else?");
}
Posted by: Guest on June-09-2020
-1

c program for determining a character is alphabet or not

You can also check the alphabet using the ASCII values of characters like this: if((ch >= 97 && ch <= 122) || (ch >= 65 && ch <= 90)) printf("The entered character %c is an Alphabet",ch); else printf("The entered character %c is not an Alphabet",ch); The ASCII value of 'a' is 97, 'z' is 122, 'A' is 65 and 'Z' is 90.
Posted by: Guest on July-20-2021

Code answers related to "c if given character is alphabet"

Code answers related to "C"

Browse Popular Code Answers by Language