单项选择题

有以下程序
#include<stdio.h>
main() {
int a=1,b=2;
while(a<6){b+=a;a+=2;b%=10;}
printf("%d,%d、n",a,b);
}
程序运行后的输出结果是()

A.5,11
B.7,1
C.7,11
D.6,1

<上一题 目录 下一题>
热门 试题

单项选择题
若有定义语句int a,b;double x;则下列选项中没有错误的是( )。
A.switch(x%2) {cage 0:a++;break; case 1:b++;break; default:a++;b++; }
B.switch((int)x/2.0) {ease 0:a++;break; case 1:b++;break; default:a++;b++; }
C.switeb((int)x%2) {case 0:a++;break; case 1:b++;break; default:a++;b++; }
D.switch((int)(x)%2) {case 0.0:a++;break; case 1.0:b++;break; default:a++;b++; }
单项选择题
有以下程序: #include<stdio.h> main() { int a=1,b=0; if(!a)b++: else if(a==0) if(a)b+=2; else b+=3: printf( %d n ,b); } 程序运行后的输出结果是()。

A.0
B.1
C.2
D.3

相关试题
  • 有以下程序 #include<stdio.h> main...
  • 若有以下语句 typedef struct S {int...
  • 有以下程序 #include<stdio.h> main...
  • 有以下程序 #include<stdio.h> #inc...
  • 有以下程序 #include<stdio.h> int ...