您好,欢迎访问三七文档
当前位置:首页 > IT计算机/网络 > C/C++资料 > C语言程序分析写结果
以下程序的输出结果是___________。main(){floata;a=1/100000000;printf(%g,a);}下面程序的输出结果是____。#includestdio.hmain(){intx=10;{intx=20;printf(%d,,x);}printf(%d\n,x);}以下程序的输出结果是____。main(){unsignedintn;inti=-521;n=i;printf(n=%u\n,n);}以下程序的输出结果是。main(){intx=10,y=10;printf(%d%d\n,x--,--y);}以下程序的输出结果是____。main(){intn=1;printf(%d%d%d\n,n,n++,n--);}以下程序的输出结果是____。main(){intx=0x02ff,y=0x0ff00;printf(%d\n,(x&y)4|0x005f);}以下程序的输出结果是____。main(){inta=1;charc='a';floatf=2.0;printf(%d\n,(!(a==0),f!=0&&c=='A'));}下面程序的输出结果是____。main(){inta=1,i=a+1;do{a++;}while(!~i++3);printf(%d\n,a);}下面程序的输出结果是____。main(){inta=111;a=a^00;printf(%d,%o\n,a,a);}下面程序的输出结果是____。main(){chars[12]=abook;printf(%.4s,s);}若输入234则下面程序的输出结果是____。main(){inta,b;scanf(%2d%3d,&a,&b);printf(a=%db=%d\n,a,b);}以下程序段的输出结果是。main(){inta=10,b=50,c=30;if(ab)a=b;b=c;c=a;printf(a=%db=%dc=%d\n,a,b,c);}以下程序的输出结果是。main(){inta=0,b=1,c=0,d=20;if(a)d=d-10;elseif(!b)if(!c)d=15;elsed=25;printf(d=%d\n,d);}下面程序的输出结果为。main(){inta=1,b=0;switch(a){case1:switch(b){case0:printf(**0**);break;case1:printf(**1**);break;}case2:printf(**2**);break;}}以下程序的输出结果是。main(){char*s=12134211;intv1=0,v2=0,v3=0,v4=0,k;for(k=0;s[k];k++)switch(s[k]){case'1':v1++;case'3':v3++;case'2':v2++;default:v4++;}printf(v1=%d,v2=%d,v3=%d,v4=%d\n,v1,v2,v3,v4);}下面程序的输出是。main(){intx=1,y=0,a=0,b=0;switch(x){case1:switch(y){case0:a++;break;case1:b++;break;}case2:a++;b++;break;}printf(a=%d,b=%d\n,a,b);}下面程序的输出是____。main(){intnum=0;while(num=2){num++;printf(%d\n,num);}}下面程序的输出结果是____。main(){inta=1,b=0;do{switch(a){case1:b=1;break;case2:b=2;break;default:b=0;}b=a+b;}while(!b);printf(a=%d,b=%d,a,b);}从键盘上输入446755时,下面程序的输出是____。#includestdio.hmain(){intc;while((c=getchar())!='\n')switch(c-'2'){case0:case1:putchar(c+4);case2:putchar(c+4);break;case3:putchar(c+3);default:putchar(c+2);break;}printf(\n);}下面程序的输出结果是____。main(){intk=0;charc='A';do{switch(c++){case'A':k++;break;case'B':k--;case'C':k+=2;break;case'D':k=k%2;continue;case'E':k=k+10;break;default:k=k/3;}k++;}while(c'C');printf(k=%d\n,k);}下面程序的输出结果是____。main(){intx,i;for(i=1;i=100;i++){x=i;if(++x%2==0)if(++x%3==0)if(++x%7==0)printf(%d,x);}}下面程序的输出结果是____。#includestdio.hmain(){inti,k,a[10],p[3];k=5;for(i=0;i10;i++)a[i]=i;for(i=0;i3;i++)p[i]=a[i*(i+1)];for(i=0;i3;i++)k+=p[i]*2;printf(%d\n,k);}假定从键盘上输入3.6,2.4回车,下面程序的输出是____。#includemath.hmain(){floatx,y,z;scanf(%f,%f,&x,&y);z=x/y;while(1){if(fabs(z)1.0){x=y;y=z;z=x/y;}elsebreak;}printf(%f\n,y);}下面程序的输出结果是____。main(){inti,j,x=0;for(i=0;i2;i++){x++;for(j=0;j-3;j++){if(j%2)continue;x++;}x++;}printf(x=%d\n,x);}下面程序的输出结果是____。main(){inti,j,k=10;for(i=0;i2;i++){k++;{intk=0;for(j=0;j=3;j++){if(j%2)continue;k++;}}k++;}printf(k=%d\n,k);}下面程序的输出结果是____。#includestdio.hmain(){intn[3][3],i,j;for(i=0;i3;i++)for(j=0;j3;j++)n[i][j]=i+j;for(i=0;i2;i++)for(j=0;j2;j++)n[i+1][j+1]+=n[i][j];printf(%d\n,n[i][j]);}下面程序的输出结果是____。#includestdio.hmain(){inta[4][5]={1,2,4,-4,5,-9,3,6,-3,2,7,8,4};inti,j,n;n=9;i=n/5;j=n-i*5-1;printf(a[%d][%d]=%d\n,i,j,a[i][j]);}下面程序的输出结果是____。intm[3][3]={{1},{2},{3}};intn[3][3]={1,2,3};main(){printf(%d\n,m[1][0]+n[0][0]);/*①*/printf(%d\n,m[0][1]+n[1][0]);/*②*/}下面程序的输出结果是____。#includestdio.hmain(){chars1[50]={somestring*},s2[]={test};printf(%s\n,strcat(s1,s2));}下面程序的输出结果是____。#includestdio.hf(char*s){char*p=s;while(*p!='\0')p++;return(p-s);}main(){printf(%d\n,f(ABCDEF));}下面程序的输出结果是____。#includestdio.h#includestring.hmain(){charstr[100]=Howdoyoudo;strcpy(str+strlen(str)/2,esshe);printf(%s\n,str);}下面程序的输出结果是____。#includestdio.hfunc(inta,intb){intc;c=a+b;return(c);}main(){intx=6,y=7,z=8,r;r=func((x--,y++,x+y),z--);printf(%d\n,r);}下面程序的输出结果是____。#includestdio.hvoidfun(int*s){staticintj=0;do{s[j]+=s[j+1];}while(++j2);}main(){intk,a[10]={1,2,3,4,5};for(k=1;k3;k++)fun(a);for(k=0;k5;k++)printf(%d,a[k]);}下面程序的输出结果是____。#includestdio.hintk=1;main(){inti=4;fun(i);printf(\n%d,%d,i,k);/*①*/}fun(intm){m+=k;k+=m;{chark='B';printf(%d,k-'A');/*②*/}printf(\n%d,%d,m,k);/*③*/}下面程序的输出结果是____。#includestdio.hfun(intn,int*s){intf1,f2;if(n==1||n==2)*s=1;else{fun(n-1,&f1);fun(n-2,&f2);*s=f1+f2;}}main(){intx;fun(6,&x);printf(%d\n,x);}下面程序的输出结果是____。intw=3;main(){intw=10;printf(%d\n,fun(5)*w);}fun(intk){if(k==0)return(w);return(fun(k-1)*k);}下面程序的输出结果是____。#includestdio.hfuna(inta){intb=0;staticintc=3;a=c++,b++;return(a);}main(){inta=2,i,k;for(i=0;i2;i++)k=funa(a++);printf(%d\n,k);}下面程序的输出结果是____。#includestdio.hvoidnum(){externintx,y;inta=15,b=10;x=a-b;y=a+b;}intx,y;main(){inta=7,b=5;x=a-b;y=a+b;num();printf(%d,%d\n,x,y);}下面程序的输出结果是____。main(){inta=2,i;for(i=0;i3;i++)printf(%4d,f(a));}f(inta){intb=0;staticintc=3;b++;c++;return(a+b+c);}下面程序的输出结果是____。#includestdio.htry(){staticintx=3;x++;return(x);}main(){inti,x;for(i=0;i=2;i++)x=try();printf(%d\n,x);}下面程序的输出结果是____。#includestdio.hmain(){intx=1;voidf1(),f2();f1();f2(x);printf(%d\n,x);}voidf1(void){intx=3;printf(%d,x);}voidf2(intx){printf(%d,++x);}下面程序的输出结果是____。#includestdio.h#defineSUB(X,Y)(X)*Ymain(){inta=3,b=4;printf(%d\n,SUB(a++,b++));}下面程序的输
本文标题:C语言程序分析写结果
链接地址:https://www.777doc.com/doc-7028526 .html