計算機概論 程式輸出問題 - 考試
By Yuri
at 2014-07-17T14:59
at 2014-07-17T14:59
Table of Contents
下列以 C 程式語言撰寫之程式執行後產生之輸出為何?
#include <stdio.h>
main()
{ int m1=123,m2=5;
while (m2--) {m1%=m2;};
printf(“%d\n”,m1);
}
a.0
b.1
c.本程式編譯時,編譯器(Compiler)發出錯誤訊息,不能執行而無輸出結果產生
d.本程式執行時,發生錯誤,故無輸出結果產生
答案為D
請問一下各位高手,是while(m2--)所造成的問題嗎?還是哪一個環節的問題啊?
--
#include <stdio.h>
main()
{ int m1=123,m2=5;
while (m2--) {m1%=m2;};
printf(“%d\n”,m1);
}
a.0
b.1
c.本程式編譯時,編譯器(Compiler)發出錯誤訊息,不能執行而無輸出結果產生
d.本程式執行時,發生錯誤,故無輸出結果產生
答案為D
請問一下各位高手,是while(m2--)所造成的問題嗎?還是哪一個環節的問題啊?
--
Tags:
考試
All Comments
By Kyle
at 2014-07-21T01:43
at 2014-07-21T01:43
By Olivia
at 2014-07-24T02:54
at 2014-07-24T02:54
By Tristan Cohan
at 2014-07-24T15:10
at 2014-07-24T15:10
By Ina
at 2014-07-27T05:17
at 2014-07-27T05:17
By Mary
at 2014-07-27T14:06
at 2014-07-27T14:06
By Eartha
at 2014-08-01T07:57
at 2014-08-01T07:57
Related Posts
方智有機化學歷屆試題90~99
By Kelly
at 2014-07-17T14:17
at 2014-07-17T14:17
行政契約與行政處分的附款區分
By Edwina
at 2014-07-17T13:16
at 2014-07-17T13:16
台灣英文大師張文忠講義俗俗賣
By Heather
at 2014-07-17T12:36
at 2014-07-17T12:36
網路概論的數學難題
By Brianna
at 2014-07-17T11:32
at 2014-07-17T11:32
請問除了統計有沒有適合數學系報考的公職
By Agatha
at 2014-07-17T11:32
at 2014-07-17T11:32