您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 咨询培训 > C语言第1至4章小测验
第__套C语言第一至四章小测验1、下面的程序,输入的整数x的值在_______________范围内时,程序才能显示运行结果。#includestdio.hvoidmain(){intx;scanf(“%d”,&x);if(x7);elseif(x!=12)printf(“%d\n”,x);}2、下面程序的输出结果是________________________。#includestdio.hvoidmain(){intx=2,y=2;if(y==0)x=5;printf(“%d,”,x);if(y!=0)x=3;elsex=5;printf(“%d\n”,x);}3、下面程序的输出结果是________________________。#includestdio.hvoidmain(){intx=0,y=1,a=2,b=3;switch(x){case1:switch(y){case0:a++;break;case1:b++;break;}case2:a++;b++;break;}printf(“a=%d,b=%d\n”,a,b);}4、下面程序的输出结果是________________________。#includestdio.hvoidmain(){intx=-1,y=2,z=2;if(xy)if(y0)z=0;elsez+=1;printf(“z=%d\n”,z);}5、下面程序的输出结果是________________________。#includestdio.hvoidmain(){inta=0,b=3,c=3;if(a--)b++,c++;elseb--;c--;printf(“a=%d,b=%d,c=%d\n”,a,b,c);}6、下面程序的输出结果是________________________。#includestdio.hvoidmain(){intk=-2;while(k++=1);printf(“last=%d\n”,k);}7、下面程序的输出结果是________________________。#includestdio.hvoidmain(){inta,b;for(a=1,b=1;a=100;a++){if(b=10)break;if(b%3==1){b+=2;continue;}b-=5;}printf(“%d\n”,a);}8、下面程序的输出结果是________________________。#includestdio.hvoidmain(){intm=3,n=6,k=1;do{if(k%m==0)if(k%n==0){printf(“%d\n”,k);break;}k++;}while(k!=0);}9、下面程序的输出结果是________________________。#includestdio.hvoidmain(){intn=0;while(n++=4);printf(“%d,”,n);printf(“%d\n”,n);}10、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){inta,b;for(a=1,b=1;a=100;a++){if(b=10)break;if(b%3==1){b+=3;continue;}b-=5;}printf(“b=%d\n”,b);}第__套C语言第一至四章小测验1、下面的程序,输入的整数x的值在_______________范围内时,程序才能显示运行结果。#includestdio.hvoidmain(){intx;scanf(“%d”,&x);if(x100);elseif(x!=50)printf(“%d\n”,x);}2、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intx=4,y=-3;if(y==0)x=5;printf(“%d,”,x);if(y!=0)x=3;elsex=5;printf(“%d\n”,x);}3、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intx=2,y=0,a=2,b=2;switch(x){case1:switch(y){case0:a++;break;case1:b++;break;}case2:a++;b++;break;}printf(“a=%d,b=%d\n”,a,b);}4、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intx=7,y=10,z=4;if(xy)if(y0)z=0;elsez+=1;printf(“z=%d\n”,z);}5、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){inta=4,b=3,c=3;if(a--)b++,c++;elseb--;c--;printf(“a=%d,b=%d,c=%d\n”,a,b,c);}6、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intk=-2;while(k++=0);printf(“last=%d\n”,k);}7、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){inta,b;for(a=1,b=1;a=100;a++){if(b=10)break;if(b%3==1){b+=3;continue;}b-=5;}printf(“%d\n”,a);}8、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intm=2,n=7,k=1;do{if(k%m==0)if(k%n==0){printf(“%d\n”,k);break;}k++;}while(k!=0);}9、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intn=0;while(n++=2);printf(“%d,”,n);printf(“%d\n”,n);}10、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){inta,b;for(a=1,b=1;a=100;a++){if(b=15)break;if(b%3==1){b+=3;continue;}b-=5;}printf(“b=%d\n”,b);}第__套C语言第一至四章小测验1、下面的程序,输入的整数x的值在_______________范围内时,程序才能显示运行结果。#includestdio.hvoidmain(){intx;scanf(“%d”,&x);if(x=10);elseif(x!=16)printf(“%d\n”,x);}2、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intx=10,y=1;if(y==0)x=5;printf(“%d,”,x);if(y!=0)x=3;elsex=5;printf(“%d\n”,x);}3、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intx=1,y=1,a=3,b=3;switch(x){case1:switch(y){case0:a++;break;case1:b++;break;}case2:a++;b++;break;}printf(“a=%d,b=%d\n”,a,b);}4、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intx=-4,y=-1,z=2;if(xy)if(y0)z=0;elsez+=1;printf(“z=%d\n”,z);}5、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){inta=3,b=1,c=1;if(a--)b++,c++;elseb--;c--;printf(“a=%d,b=%d,c=%d\n”,a,b,c);}6、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intk=0;while(k++=4);printf(“last=%d\n”,k);}7、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){inta,b;for(a=1,b=1;a=50;a++){if(b=10)break;if(b%3==1){b+=4;continue;}b-=5;}printf(“%d\n”,a);}8、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intm=5,n=7,k=1;do{if(k%m==0)if(k%n==0){printf(“%d\n”,k);break;}k++;}while(k!=0);}9、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intn=0;while(n++=3);printf(“%d,”,n);printf(“%d\n”,n);}10、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){inta,b;for(a=1,b=1;a=100;a++){if(b=19)break;if(b%3==1){b+=3;continue;}b-=5;}printf(“b=%d\n”,b);}第__套C语言第一至四章小测验1、下面的程序,输入的整数x的值在_______________范围内时,程序才能显示运行结果。#includestdio.hvoidmain(){intx;scanf(“%d”,&x);if(x7);elseif(x!=0)printf(“%d\n”,x);}2、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intx=-7,y=0;if(y!=0)x=5;printf(“%d,”,x);if(y==0)x=3;elsex=5;printf(“%d\n”,x);}3、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intx=1,y=0,a=1,b=1;switch(x){case1:switch(y){case0:a++;break;case1:b++;break;}case2:a++;b++;break;}printf(“a=%d,b=%d\n”,a,b);}4、下面程序的输出结果是_______________________。#includestdio.hvoidmain(){intx=1,y=4,z=3;if(xy)if(y0)z=0;elsez+=1;printf(“z=%d\n”,z);}5、下面程序的输出结果是_______________________。#includestd
本文标题:C语言第1至4章小测验
链接地址:https://www.777doc.com/doc-2908366 .html