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.
Related Topic: Write a C Program to Check Odd or Even Using Conditional Operator?
For Video Explanations Check Out Our Playlist on Youtube HERE.
#Interview #Preperation #Placement #OffCampusing #Engineering #OnCampus #PrivateJobPreperation #JobPreperation#CodingPreperation #AMCAT #Automata #JobsforGraduates #HighestPayingJobsforGraduates
#coding #codinglife #codingisfun #codingproblems #CoffeeWithCodes #CWC #Cprogramming #cprogramminglanguage #competitiveprogramming