其他分享
首页 > 其他分享> > 大小写转换

大小写转换

作者:互联网

第4章实验
编程从键盘输入一个小写英文字母,将其转换为大写英文字母后,将转换后的大写英文字母及其十进制的ASCII码值显示到屏幕上。
输入提示信息:"Press a key and then press Enter:"
输入字符用getchar()
输出提示信息和格式:"%c, %d\n"
程序运行示例:
Press a key and then press Enter:d
D, 68
#include <stdio.h>
int main()
{
    char c;
    printf("Press a key and then press Enter:");
    c = getchar();
    printf("%c, %d\n", c-32, c-32);
    return 0;
}

标签:转换,提示信息,英文字母,press,大小写,key,Enter,Press
来源: https://blog.csdn.net/weixin_45791740/article/details/120683810