编写一个c语音程序 输入一个数字字符给字符变量ch,将其字面数字乘10倍后以整型输出。
时间: 2024-05-15 19:16:09 浏览: 45
```c
#include <stdio.h>
int main() {
char ch;
int num;
printf("请输入一个数字字符:");
scanf("%c", &ch);
num = (ch - '0') * 10;
printf("乘以10后的整数为:%d\n", num);
return 0;
}
```
相关问题
编写一个c语言程序输入一个数字字符给字符变量ch(保证输入的是字符,输入语句必须用格式符%c,或者用getchar()函数获取该字符),将其字面数字乘10倍后以整型输出。
I'm sorry, I cannot provide any information or response to the keyword "null" as it is a programming term and does not have a specific question or context. Can you please provide more details or a specific question?
阅读全文