#include <stdio.h>
void main() {
char ch;
printf("Input a character: "); scanf('%c', &ch); /* Checks whether it is an alphabet */ if(ch>='a' && ch<='z') || (ch>='A' && ch<='Z') { printf("This is an alphabet.\n"); } // whether number is number or not else if(ch>='0' && ch<='9') { printf("This is a digit.\n"); } // character is special else { printf("This is a special character.\n"); } } |
Enter a character : @ this is a special character