更多"[单选题]以下程序的输出结果是( )。
main()
{ int a,"的相关试题:
[单选题]以下程序输出结果是()。
main()
{ int m=5;
if(m++>5) printf("%d\n",m);
esle printf("%d\n",m- -);
}
A.7
B.6
C.5
D.4
[单选题]以下程序段输出结果是()。
main()
{ int k,j,s;
for(k=2;k<6;k++,k++)
{ s=1;for(j=k;j<6;j++) s+=j;}
printf(“%d\n”,s);}
A.9
B.1
C.11
D.10
[单选题]以下程序的输出结果是()。
main()
{ int i,j,x=0;
for(i=0;i<2;i++)
{ x++;
for(j=0;j<3;j++)
{ if(j%2)continue;
x++;
}
x++;
}
printf("x=%d\n",x);
}
A.x=4
B.x=8
C.x=6
D.x=12
[单选题]以下程序的输出结果是()。
main()
{ int a=4,b=5,c=0,d;
d=!a&&!b||!c;
printf("%d\n",d);}
A.1
B.0
C.非0数
D.-1
[单选题]下面程序的输出结果是 ( )。
main()
{ int a[10]={1,2,3,4,5,6,7,8,9,10},*p=a;
printf("%d\n",*(p+2));}
A.3
B.4
C.1
D.2
[单选题]下列程序的输出结果是()。
main()
{ double d=3.2; int x,y;
x=1.2; y=(x+3.8)/5.0;
printf("%d \n", d*y);
}
A.3
B.3.2
C.0
D.3.07
[单选题]以下程序的输出结果是()。
#define M(x,y,z) x*y+z
main()
{ int a=1,b=2, c=3;
printf("%d\n", M(a+b,b+c, c+a));
}
A.19
B.17
C.15
D.12
[单选题]以下程序的输出结果是()。
func(int a,int b)
{ int c;
c=a+b;
return c;}
main( )
{ int x=6,y=7,z=8,r=0;
r=func((x--,y++,x+y),z--);
printf(“%d\n”,r);}
A.11
B.20
C.21
D.31
[单选题]以下程序的输出是()。
struct st
{ int x; int *y;} *p;
int dt[4]={ 10,20,30,40 };
struct st aa[4]={ 50,&dt[0],60,&dt[0],60,&dt[0],60,&dt[0],};
main()
{ p=aa;
printf("%d\n",++(p->x));
}
A.10
B.11
C.51
D.60
[单选题]以下程序的输出结果是()。
union myun
{ struct
{ int x, y, z; } u;
int k;
} a;
main()
{ a.u.x=4; a.u.y=5; a.u.z=6;
a.k=0;
printf("%d\n",a.u.x);}
A.4
B.5
C.6
D.0
[单选题]以下程序的输出结果是()。
struct HAR
{ int x, y; struct HAR *p;
} h[2];
main()
{h[0].x=1;
h[0].y=2;
h[1].x=3;
h[1].y=4;
h[1].p=&h[1];
h[1].p=h;
printf("%d %d \n",(h[0].p)->x,(h[1].p)->y);
}
A.1 2
B.2 3
C.1 4
D.3 2
[单选题]下面程序的运行结果是( )
Main()
{ int i;
For(i=1;i<=5;i++)
Switch(i%5)
{ case 0 . printf("*");break;
Case 1 . printf("#");break;
Default . printf("\n");
Case 2 . printf("&"); } }
A. #& & &
B. #& & &*
C. #
D. #&
[单选题]下面程序的输出结果是()。
#include
#include
main()
{ char *p1="abc",*p2="ABC",str[50]= "xyz";
strcpy(str+2,strcat(p1,p2));
printf("%s\n",str);}
A.xyzabcABC
B.zabcABC
C.xyabcABC
D.yzabcABC
[单选题]下面程序的运行结果是( )
Main()
{int x,i,j;
For(i=1;i<=100;i++)
{ x=i;
If(++x%2==0)
If(++x%3==0)
If(++x%7==0)
Printf("%d ",x); } }
A. 39 81
B. 42 84
C. 26 68
D. 28 70
[单选题]下面程序的运行结果是( )
Main()
{ int i,b,k=0;
For(i=1;i<=5;i++)
{ b=i%2;
While(b-->=0) k++; }
Printf("%d,%d",k,B.; }
A. 3,-1
B. 8,-1
C. 3,0
D. 8,-2
[单选题]下列程序的输出结果是 ( )。
#include "stdio.h"
main()
{ int i,a=0,b=0;
for(i=1;i<10;i++)
{ if(i%2==0)
{a++;
continue;}
b++;}
printf("a=%d,b=%d",a,b); }
A.a=4,b=4
B. a=4,b=5
C. a=5,b=4
D. a=5,b=5
[单选题]以下程序运行后,输出结果是 ()。
fut (int **s,int p[2][3])
{ **s=p[1][1];)
main()
{ int a[2][3]={1,3,5,7,9,11},*p;
p=(int *)malloc(sizeof(int));
fut (&p,a);
printf("%d\n",*p);
}
A.1
B.7
C.9
D.11
[单选题]以下程序的输出结果是()。
long fun( int n)
{ long s;
if(n==1||n==2)s=2;
else s=n-fun(n-1);
return s;}
main()
{ printf("%ld\n", fun(3)); }
A.1
B.2
C.3
D.4
[单选题]有以下程序
int fun(int x,int y,int *cp,int *dp)
{ *cp=x+y; *dp=x-y; }
main()
{ int a, b, c, d;
a=30; b=50;
fun(a,b,&c,&d);
printf("%d,%d\n", c, d);
}
输出结果是()。
A.50,30
B.30,50
C.80,-20
D.80,20