-->
当前位置:首页 > 题库

单选题:What is the output of the following piece of code?

Luz5年前 (2021-05-10)题库771
What is the output of the following piece of code? @[C](2)
```
int num=0, s=0;
while(num<=2){
num++;
s+=num;
}
printf("%d\n",s);
```
A. 1
B. 3
C. 6
D. 10




A.1
B.3
C.6
D.10


答案:C