20.試修改prog4_22,使得字元的輸出是利用putchar()函數,而不是用printf()函數。

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main (void)
{
    char ch;
    printf("輸入一個字元\n");
    ch=getche(); 
    printf("您輸入的字元是:\n");
    putchar(ch);
    putchar('\n');
    
    printf("輸入一個字元\n");
    ch=getch(); 
    printf("您輸入的字元是:\n");
    putchar(ch);
    putchar('\n');
    
    system ("pause");
    return 0;
}

arrow
arrow
    文章標籤
    作業 CH4
    全站熱搜

    小宥韓諾非 發表在 痞客邦 留言(0) 人氣()