输入一个字符,判断该字符是大写英文字母,小写英文字母,空格,还是其它字符
看代码
#include <stdio.h> void main() { char c; printf("Enter a char:"); c=getchar(); if(c<32) printf("The char is control char."); else if(c>='0'&&c<='9') printf("The char is a digit char."); else if (c>='A'&&c<='Z') printf("The char is a captal char."); else if(c>='a'&&c<='z') printf("The char is a lower char."); else printf("The char is an other char."); return 0;