Check character entered is a special character or not
#include<stdio.h>
#include<conio.h>
int main() {
char ch;
printf("\nEnter The Character : ");
scanf("%c", &ch);
if (ch >= 'A' && ch <= 'Z') {
printf("Character is not Special");
} else if (ch >= 'a' && ch <= 'z') {
printf("Character is not Special");
} else {
printf(" Character Is Special");
}
return(0);
}
Output:-
Enter The Character : w
Character is not Special
Enter The Character : @
Character Is Special
Comments
Post a Comment