题目内容

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

查看答案
更多问题

main() {int s=0,a=1,n; scanf(“%d”,&n); do {s+=1;a=a-2;} while(a!=n); printf("%d\n”,s); }If you want the output value of the program to be 2, the value you should enter for n from the keyboard is ( ).

A. –1
B. –3
C. –5
D. 0

%f of scanf function, used to enter single precision real number in decimal form.

Empty type is not a data type of C language.

All variables used in C must have their data type specified.

答案查题题库