1、定义单字符变量赋值大写,输出小写,以及ASCll值
代码:
char str1='a';
printf("str1的大写:%c,以及ascii码值:%d\n",str1-32,str1);
2、定义单字符变量赋值小写,输出大写,以及ASCIl值
代码:
char str2='B';
printf("str2的大写:%c,以及ascii码值:%d\n",str2+32,str2);
3、定义单字符变量赋值单字符数字,输出对应的数字
代码:
char num='0';
printf("num为:%c,以及ascii码值:%d\n",num,num);