C语言初学 if-else语句判别在ASCII值中小于32的可控制符的类型

#include<stdio.h>

main()

{

char c;

printf("输入一个符号 ");

c=getchar();

if(c<32) 

printf("该字符为可控制符 ");

else if(c>='0'&&c<='9')

printf("该字符为数字 ");

else if(c>='A'&&c<='Z')

printf("该字符为大写字母 ");

else if(c>='a'&&c<='z')

printf("该字符为小写字母 ");    

return 0;

}

 
原文地址:https://www.cnblogs.com/lj-1568/p/4376652.html