題組內容

三、請閱讀以下的C程式片斷並依指示進行改寫: (1) 不使用goto指令而印出與原程式有相同輸出結果之程式;(2) 不使用switch指令而印出與原程式有相同輸出結果之程式。(20分)


(1) if (x < y) goto happy123;
else goto happy 456;
happy123: printf (“yes”);
happy456: printf (“no”);