35. C Program To Check the Given Character is Lowercase or Uppercase or Special Character.
How does this program work?
- This program is used to compare the given Character.
- Here we use the "char" to store the user input.
- By comparing the given input using if case. we get the output.
Here is the code
#include <stdio.h>
int main(void)
{
char ch;
printf("Enter any character: \n");
scanf("%c", &ch);
if(ch >= 'A' && ch <= 'Z')
{
printf(" '%c' is uppercase alphabet.", ch);
}
else
if(ch >= 'a' && ch <= 'z')
{
printf(" '%c' is lowercase alphabet.", ch);
}
else
if(ch >= '0' && ch <= '9')
{
printf(" '%c' is digit.", ch);
}
else
printf(" '%c' is special character.", ch);
return 0;
}