Multiple cases in a switch statement can share a group of execution statements.
查看答案
Perform the following procedure, input 3 and the output is ( ). #include “stdio.h” main() { int k; scanf(”%d”, &k); switch(k) { case 1: printf(”%d\n”, k++); case 2: printf(”%d\n”, k++); case 3: printf(”%d\n”, k++); case 4: printf(”%d\n”, k++); break; default: printf(”Full!\n”); }}
A. 3
B. 4
C. 34
D. 44
while and do while statements have the same function.
Three expressions in the for loop statement, omitting the second expression indicates that the loop condition is true.
When executing the following segments ( ) x=-1; do {x=x*x;} while (!x);
A. Loop body will execute once
B. The loop body will execute twice
C. The loop body will execute many times
D. You will be prompted for a syntax error