Search
Write a C Program to Check whether the entered value is Alphabet or Not?
Write a C Program to Check whether the entered value is Alphabet or Not?
#include <stdio.h>
int main()
{
char c;
printf("Enter a character: ");
scanf("%c",&c);
if( (c>='a' && c<='z') || (c>='A' && c<='Z'))
printf("%c is an alphabet.",c);
else
printf("%c is not an alphabet.",c);
return 0;
}
Output:
Case 1:
Enter a character: *
* is not an alphabet.
Case 2:
Enter a character: d
d is an alphabet.
Case 3:
Enter a character: T
T is an alphabet.
Comments