36. C Program To Check Character is Lowercase or Uppercase or Special Character using switch case.
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 switch case. we get the output.
Here is the code
#include <stdio.h>
int main(void)
{
char i;
printf("Enter a character: \n");
scanf("%c",&i);
switch(i)
{
case 'A'...'Z':
printf("Upper case character\n");
break;
case 'a'...'z':
printf("Lower case character\n");
break;
case '0'...'9':
printf("Digit \n" );
break;
default:
printf("Special character\n");
}
return 0;
}