循环结构

【1】若变量已正确定义,执行以下while语句将陷入死循环。

1
2
3
i = 1;
while (i <= 10) ;
i++;

正确答案:T
错因:忽略了第二行句末的分号

结构体

【1】对于以下定义,错误的scanf函数调用语句是()

1
2
3
4
5
struct pupil{ 
char name[20];
int age;
int sex;
}pup[5];

A. scanf("%s", &pup[0].name);

B. scanf("%d", &pup[1].age);

C. scanf("%d", &pup[2].sex);

D. scanf("%s", pup[4].name);

正确答案:A
我的选择:D
错因: