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

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/02 02:47:43
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

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.