Write a C program to Check whether a given character is upper case, lower case, number or special character
Program:-
#include
int main()
{
char ch;
scanf(“%c”,&ch);
if(ch >= 65 && ch <= 90)
printf(“Upper”);
else if(ch >= 97 && ch <= 122)
printf(“Lower”);
else if(ch >= 48 && ch <= 57)
printf(“Number”);
else
printf(“Symbol”);
return 0;
}
int main()
{
char ch;
scanf(“%c”,&ch);
if(ch >= 65 && ch <= 90)
printf(“Upper”);
else if(ch >= 97 && ch <= 122)
printf(“Lower”);
else if(ch >= 48 && ch <= 57)
printf(“Number”);
else
printf(“Symbol”);
return 0;
}
Output:-
....
0 comments:
Post a Comment