cprimer_study/c03_data/charcode.c

13 lines
231 B
C

/* charcode.c - 显示字符的代码编号 */
#include <stdio.h>
int main(void)
{
char ch;
printf("Please enter a character.\n");
scanf("%c", &ch);
printf("The code for %c is %d.\n", ch, ch);
return 0;
}