How many times will the body of the following loop be executed?int sum = 0; int n;for (n = 9; n > 0; n = n / 2)sum = sum + n;(a) once(b) twice(c) four times(d) three times 为什么答案是三次呢?不是四次么?n=9,4,2,1各一次?
来源:学生作业学帮网 编辑:学帮网 时间:2024/06/01 05:50:44
How many times will the body of the following loop be executed?
int sum = 0;
int n;
for (n = 9; n > 0; n = n / 2)
sum = sum + n;
(a) once
(b) twice
(c) four times
(d) three times
为什么答案是三次呢?不是四次么?n=9,4,2,1各一次?
because the first time n=4; second time n=2; third time n=1.
no more.
the question is how many time the body is executed,however n=9 is defined,not a result from execution.
:-)
how many times we will sea googbye?
how many times we will say goodbye
How many times?! 歌词
How Many Times,How Many Lies 歌词
how many times 如何回答
no matter how many times
how many times和how many time的区别
hoe many times与how ofen区别
When和How many times的区别
-_____ will he go back to England?-In a month.A.How many times B.How often C.How soon D.How long
翻译:you will fail many times.
( )will he stay here?A.How many times B.How often C.what time D.How long回答下列括号中的
How often 和how many times有什么区别吗?
How many times 和 How often的区别
初中英语how often 于how many times的区别是什么?
关于how often和how many times的例句
how ofen与how many times的区别
how many times 与how long 的区别