/***************************************************************** アスキーコードを表示する(複数文字対応、改行で終了) ex01/prog01b.c Last update: Sep 10 2026 *****************************************************************/ #include int main() { char c; printf("Enter any characters: "); while (1) { /* 無限ループ */ scanf("%c", &c); if (c == '\n') break; /* 改行ならループから抜ける */ /* 出力 */ printf("'%c': %3d (Decimal) / 0x%02x (Hexadecimal)\n", c, c, c); } return 0; }