17.
Analyze the following statement:
double sum = 0;
for (double d = 0; d < 10;) {
d += 0.1;
sum += sum + d;
}
回答错误
单选题 (2 分) 0 分
- A.
The program compiles and runs fine.
- B.
The program has a compile error because the control variable in the for loop cannot be of the double type.
- C.
The program runs in an infinite loop because d<10 would always be true.
- D.
The program has a compile error because the adjustment is missing in the for loop.
30.
You can always convert a while loop to a for loop.
回答错误
判断题 (2 分) 0 分
- A.
true
- B.
false
41.
You can always write a program without using break or continue in a loop.
回答错误
判断题 (2 分) 0 分
- A.
false
- B.
true