从键盘输入一个大写英文字母,将其转换为小写字母后,再显示到屏幕上(显示字符后要输出一个换行)。

img

#include <stdio.h>
int main()
{
    char c;
    printf("Press a key and then press Enter:");
    scanf("%c",&c);
    printf("%c\n",c+32);
    return 0;
}

#include<stdio.h>
int main()
{
char ch;
ch=getchar();
if(ch>='A'&&ch<='Z')
{
ch+=32;
printf("%c\n",ch);
}
else if(ch>='a'&&ch<='z')
{
ch-=32;
printf("%c\n",ch);
}

return 0;

} //觉得有用的话采纳一下,谢谢

直接用字符加32就是小写字母了。