【单选题】以下程序的输出结果是()#includeintmain(void){intnum=0;while(num<=2){num++;printf("%d
",num);}return0;}
A. 1
B. 1 2
C. 1 2 3
D. 1 2 3 4
",num);}return0;}
A. 1
B. 1 2
C. 1 2 3
D. 1 2 3 4
举一反三
- 下列程序的输出结果是() num = 27 count = 0 while num > 0: if num % 2 == 0: num /=2 elif num % 3 ==0: num /= 3 else: num -=1 count += 1 print (count)
- 以下程序段的输出结果是 。 int main(void) { int num = 0,s = 0; while(num <= 2){ num++; s += num; } printf("%d\n",s); return 0; }
- 以下程序段的输出结果是( )。int main(){int num=0,s=0;while(num<=2) { num++; s+=num; } printf("%d\n",s);}A)10 B)6 C)3 D)1 A: 1 B: 3 C: 10 D: 6
- 有如下程序段,执行后的输出结果是______。#include<stdio.h>main(){structa{intx;inty;}num[2]={{20,5},{6,7}};printf(''%d'',num[0].x/num[0].y*num[1].y);}
- 下列程序执行后的输出的结果是#include<stdio.h>intmain(){inta[4][4]={{1,3,5},{2,4,6},{3,5,7}};printf("%d%d%d%d\n",a[0][3],a[1][2],a[2][1],a[3][0]);return0;}