計算機概論 程式輸出問題 - 考試
By Noah
at 2014-07-16T16:11
at 2014-07-16T16:11
Table of Contents
考慮以下 C 程式
int fun (int *x) {
*x += 4;
return 4 * (*x) –2;
}
void main() {
int x = 20, y = 30, w,z;
w = fun(&x) + (x/2);
z = fun(&y) + (y/2); printf(“%d,%d”, w,z);
}
程式執行後,w, z 的值為何?
a.48與151 b.106與151 c.104與133 d.48與133
答案為b
想請問各位高手他是怎麼運算的啊?
--
int fun (int *x) {
*x += 4;
return 4 * (*x) –2;
}
void main() {
int x = 20, y = 30, w,z;
w = fun(&x) + (x/2);
z = fun(&y) + (y/2); printf(“%d,%d”, w,z);
}
程式執行後,w, z 的值為何?
a.48與151 b.106與151 c.104與133 d.48與133
答案為b
想請問各位高手他是怎麼運算的啊?
--
Tags:
考試
All Comments
By Hedwig
at 2014-07-16T20:40
at 2014-07-16T20:40
By Belly
at 2014-07-17T20:15
at 2014-07-17T20:15
By Zenobia
at 2014-07-21T00:08
at 2014-07-21T00:08
By Irma
at 2014-07-24T22:52
at 2014-07-24T22:52
By Skylar Davis
at 2014-07-28T10:07
at 2014-07-28T10:07
Related Posts
關於司律的補習小問題
By Cara
at 2014-07-16T15:15
at 2014-07-16T15:15
不知如何選擇學士後中醫和重考...
By Selena
at 2014-07-16T15:12
at 2014-07-16T15:12
中央印製廠 印刷工程員
By Margaret
at 2014-07-16T14:25
at 2014-07-16T14:25
阿基米德-浮力問題
By Charlotte
at 2014-07-16T13:32
at 2014-07-16T13:32
林智有機
By Xanthe
at 2014-07-16T12:59
at 2014-07-16T12:59