Learn about Check Character is a Lowercase Alphabet or Not using If Else Program in C in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.
C Program to Check Character is a Lowercase Alphabet or Not
The character is taken as a input from the user and using the ASCII value of the character we checked whether it is a lowercase or not.
Program:
#include<stdio.h>
int main()
{
char ch;
printf("Enter a character: ");
scanf("%c",&ch);
if(ch>=97 && ch<=122)
{
printf("%c is a lowercase alphabet.",ch);
}
else
{
printf("%c is not a lowercase alphabet.",ch);
}
return 0;
}
Output:
Enter a character: a
a is a lowercase alphabet.
Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.
Similar Codes :
Check Character is an Uppercase Alphabet or not using If Else Program in C
Program to Evaluate the Result of a Student