单项选择题

有以下程序
#include<stdio.b>
main() {
int y=10;
While(y-);
printf("y=%d\n",y);
}
程序执行后的输出结果是()

A.y=0
B.y=-1
C.y=1
D.while构成无限循环

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

单项选择题
有以下程序 #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...
  • 若有以下语句 typedef struct S {int...
  • 有以下程序 #include<stdio.h> main...
  • 有以下程序 #include<stdio.h> #inc...
  • 有以下程序 #include<stdio.h> int ...