下面程序的输出结果是________ #include "stdio.h" main() {int iX=3; switch(iX) { case 1: case 2: printf("iX<3 "); case 3: printf("iX=3 "); case 4: case 5: printf("iX>3 "); default: printf("iX unknow "); } }
举一反三
- 下面程序的输出结果是[br][/br] iX=3[br][/br] iX>3[br][/br]____ 。[br][/br]#include "stdio.h"[br][/br]main()[br][/br]{int iX=3;[br][/br] switch(iX)[br][/br] { case 1:[br][/br] case 2: printf("iX[3\n");<br] case 3: printf("iX=3\n");[br][/br] case 4:[br][/br] case 5: printf("iX>3\n");[br][/br] default: printf("iX unknow\n");[br][/br] }[br][/br]}
- 执行下列程序,输入为3的数出结果是()。 #include ”stdio.h” main() { int k; scanf(”%d”, &k); switch(k) { case 1: printf(”%d ”, k++); case 2: printf(”%d ”, k++); case 3: printf(”%d ”, k++); case 4: printf(”%d ”, k++); break; default: printf(”Full! ”); } }
- 下面程序的运行结果是 iX=80,iY=25____。void main(){ int iX,iY;iX=80;iY=25;printf("iX=%d,iY=%d\n",iX,iY);printf("iX/iY=%d,iX%iY=%d\n",iX/iY,iX%iY);}
- 中国大学MOOC: 以下程序输出的结果是()# include <stdio.h>int main(){ int a = 4; switch(a ) { case 0: printf("this is 0\n"); break; case 1: printf("this is 1\n"); break; case 2: printf("this is 2\n"); break; default: printf("this is default\n"); } return 0;
- 以下程序的输出结果是 main() { int a=0,i; for(i=1;i < 5;i++) { switch(i) { case 0: case 3:a+=2; case 1: case 2:a+=3; default:a+=5; } } printf("%d\n",a); }