题目内容

2.在C语言中,以下说法正确的是( )。

A. 不能使用do-while语句构成的循环。
B. do-while语句构成的循环必须用break语句才能退出。
C. do-while语句构成的循环,当while语句中的表达式值为非零时结束循环。
D. do-while语句构成的循环,当while语句中的表达式值为零时结束循环。

查看答案
更多问题

3.C语言中while和do-while循环的主要区别是()。

A. do-while的循环体至少无条件执行一次。
B. while的循环控制条件比do-while的循环控制条件严格。
C. do-while允许从外部转到循环体内。
D. do-while的循环体不能是复合语句。

4.以下程序段()。int x=-1;do{x=x*x;} while (!x);

A. 是死循环。
B. 循环执行二次。
C. 循环执行一次。
D. 有语法错误。

5.以下程序的输出结果是()。#include int main(void){int num=0;while(num<=2){num++;printf("%d",num);}return 0;}

A. 1
B. 1 2
C. 1 2 3
D. 1 2 3 4

Read the statements. Write T (true), F (false) or DS (doesn’t say).1. Sally says she spends over three hours a day driving.2. Ruth thinks that the streets will be unsafe if driverless cars become a reality.3. Sally believes that driverless cars will benefit the economy.4. Ruth has great faith in technology.5. Sally predicts that people are more likely to share driverless cars.6. Ruth believes that driverless cars will be too expensive for most people to afford.

答案查题题库