What value will be output when the following program segment is executed?int k,sum = 0;for (k = 0; k

来源:学生作业帮助网 编辑:作业帮 时间:2024/08/15 09:04:04
What value will be output when the following program segment is executed?int k,sum = 0;for (k = 0; k
xPn0 UW^سC,BDaUaw{7&XIqvPØ`~ !SH𘔧/ӆ?gЬ ;V[ϖw+1z7.ɍ*YZѹ6J.*4B.Ph|S =e(䰔7 BCN`eeS ȃX%$l3$mwEkN/Wݿ

What value will be output when the following program segment is executed?int k,sum = 0;for (k = 0; k
What value will be output when the following program segment is executed?
int k,sum = 0;
for (k = 0; k

What value will be output when the following program segment is executed?int k,sum = 0;for (k = 0; k
got a little confused, in the function sum=sum+k, if sum be a constant, the answer
(b) should be right, if the sum is a variable like k, answer (a) is right, program will run 6 times, it's more reasonable.