✅ 操作成功!

【C语言学习笔记(一)】ASCII码转字符

发布时间:2023-06-13 作者:admin 来源:文学

【C语言学习笔记(一)】ASCII码转字符

【C语言学习笔记(一)】ASCII码转字符

一、要求 提示输入一个ASCII码值(如,66),然后打印输入的字符。 二、程序 使用printf()函数进行强制转换。

#include <stdio.h> int main() { int ascii; printf("Enter an ASCII code:"); scanf("%d",&ascii); printf("%d is the ASCII code for %c.\\n",ascii,ascii);//printf()函数类型强制转换 return 0; }

三、结果

👁️ 阅读量:0