现有如下程序段 #include"stdio.h" main() { int a[5][6]={23,3,65,21,6,78,28;5,67,25,435,76,8,22,45,7,8,34,6,78,32,4,5,67,4,21,1}; int i=0,j=5; printf("%d\n",*(&a[0][0]+2*i+j-2));} 则程序的输出结果为
A.21
B.78
C.23
D.28
第1题:
下列程序的运行结果为( )
#include<stdio.h>
main()
{ struc tdate
{int year,month,day;
)today;
printf("%d\n",sizeof(struct date));
}
A.8
B.6
C.10
D.12
第2题:
阅读如下程序段
#include "stdio.h"
main()
{ int x,a,b;
scanf("%d",&x);
a=b=x;
for(;x!=0;)
{ if(x
输入后输出结果是
A.a=7569,b=789
B.a=5,b=365
C.a=7,b=789
D.a=7569,b=5
第3题:
现有如下程序段
#include "stdio.h"
int aa(int x,int y);
main()
{int a=24,b=16,c;
c=aa(a,b);
printf("%d\n",c);}
int aa(int x,int y)
{int w;
while(y)
{w=x%y;
x=y;
y=w;}
return x;}
则程序段的输出结果是
A.8
B.7
C.6
D.5
第4题:
下列程序的输出结果是( )。 #include<stdio.h> int b=2; int fune(int*a) { b+=*a;return b;} main() { int a=1,t=2; t+=func(&a); printf("%d\n",t); }
A.4
B.5
C.6
D.8
第5题:
有以下程序:#include <stdio.h>main( ){ int a=1,b; for(b =1;b <=10;b++) { if(a> =8) break; if(a%2 == 1) {a + =5;continue;} a- =3; printf( "% d \n" ,b);}程序运行后的输出结果( )。
A.3
B.4
C.5
D.6
第6题:
有以下程序 #include<stdio.h> main() { int a=5,b=lt; t=(a<<2)|b;printf("%d\n",t); } 程序运行后的输出结果是______。
A.21
B.11
C.6
D.1
第7题:
有以下程序: #include<stdio.h> #define X 5+6 main() {int a=2,c; C=X*2: printf("%d",C); } 程序运行后的输出结果是( )。
A.17
B.22
C.16
D.11
第8题:
下列程序舶输出结果是【 】。
include <stdio.h>
main()
{
int a[5]={2,4,6,8,10},*p;
p=a;p++;
printf("%d",*p);
}
第9题:
有如下程序#include "stdio.h"void fun(int *a,int *b){ int m; m=(*a+*b)*(*a+*b); m+=(*a-*b)*(*a-*b); printf("%d\n",m);}main(){ int a=5,b=6,*x=&a,*y=&b; fun(x,y);}程序执行后输出的结果为A.120 B.121 C.122 D.123
第10题:
若有以下程序
#include <stdio.h>
int a[ ]={2,4,6,8};
main( )
{ int i;
int *p=a;
for(i=0;i<4;i++) a[i]=*p;
printf("%d\n",a[2]);}
上面程序的输出结果是
A.6
B.8
C.4
D.2
第11题:
以下程序的输出结果是______。 #include<stdio.h> main() { int a=5,b=4,c=6,d; printf("%d\n",d=a>b?(a>c?a:c):(b)); }
A.5
B.4
C.6
D.不确定
第12题:
现有如下程序段
#include "stdio.h"
int *fun(int *a,int *b)
{int c;
c=*a%*b;
return &c;}
main()
{int a=5,b=19,*c;
c=fun(&a,&b);
printf("%d\n",++*c);}
则程序段执行后的结果为
A.8
B.7
C.6
D.5
第13题:
现有如下程序段,则程序段的输出结果为 【16】 。
#include "stdio.h"
int fun()
{static int k;
return k;}
main()
{int m;
m=fun();
printf("%d\n",m);}
第14题:
现有如下程序段
#include "stdio.h"
int fun(int k,int *m)
{if(k%3)*m=k*k;
else *m=k/3;}
main()
{ int (*p)(int,int *),m;
p=fun;
(*p)(78, &m);
printf( "%d\n",m);}
则程序段的输出结果为
A.24
B.25
C.26
D.27
第15题:
有如下程序: #include <stdio.h> int func(int a,int b) { return(a+b):} main() { int x=2,y=5,z=8,r; r=func(func(x,y),z); printf("%d\n",r); } 该程序的输出结果是( )。
A.12
B.13
C.14
D.15
第16题:
下面程序的输出结果是 ( ) # include<stdio.h> main( ) { int i,a[ ]={2,4,6,8}; int * p=a; for(i=0;i<4;i+ +)a[i]=* p+ +; printf(*%d\n",a[2]); }
A.6
B.8
C.4
D.2
第17题:
有如下程序段: #include<stdio.h> #define Max(a,b) a>b?a:b main() { int a=5,b=6,c=4,d; d=c+Max(a,b); printf("%d",d); } 其输出结果为______。
A.10
B.5
C.6
D.编译错误
第18题:
下面程序的运行结果是( )。
include<stdio.h>
main()
{int a=25;
fun(&A);
}
fun(int *x)
{ printf("%d\n",++*x);
}
第19题:
有以下程序 #include <stdio.h> main() { int i=5; do { if(i%3==1) if(i%5==2) { printf"*%d",i); break; } i++; } while(i!=0); printf("\n"); } 程序的运行结果是______。
A.*7
B.*3*5
C.*5
D.*2*6
第20题:
下面的程序段中,有( )处错误和警告。 #include<stdio.h> int main() int x; cin>>x cout<<x; }
A.1
B.2
C.3
D.4
第21题:
有如下程序 #include<stdio.h> main() { int a[4][4]={{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16)); int i,s=0; for(i=0;i<4;i++)s+=a[i][1]; printf("%d\n",s); }程序运行后的输出结果是______。
A.11
B.32
C.13
D.20
第22题:
有如下程序: #include<stdio.h> main() { int n=9; while(n>6){n--;printf("%d",n);} } 该程序的输出结果是( )。
A.987
B.876
C.8765
D.9876
第23题:
有如下程序段: #include <stdio.h> #define Max(a,b) a>b?a:b main() { int a=5,b=6,c=4,d; d=c+Max(a,b) ; printf("%d",d) ; } 其输出结果为______。
A.10
B.5
C.6
D.编译错误