下列程序的输出结果是
#include "stdio.h"
#define N 3
#define M 3
void fun(int a[M][N])
{printf("%d\n",*(a[1]+2));}
main()
{int a[M][N];
int i,j;
for(i=0;i<M;i++)
for(j=0;j<N;j++)
a[i][j]=i+j-(i-j);
fun(a);}
A.3
B.4
C.5
D.6
第1题:
下列程序的输出结果是
#include "stdio.h"
#defineM(x,y)x%y
main()
{ int a,m=12,n=100;
a=M(n,m);
printf("%d\n",a--);}
A.2
B.3
C.4
D.5
第2题:
下列程序的输出结果是______。# include<stdio.h>f(char 8s){ char *p=s; while(*p!='\0')p++; return(p-s);}main(){ printf("%d\n",f("ABCDEF"));}
A.3
B.6
C.8
D.0
第3题:
执行以下程序的输出结果是( )。
include<stdio.h>
define M 5
define N M+M
main()
{ int k;
k=N*N*5;printf(”%d\n" ,k);
}
第4题:
下列程序的输出结果是( )。 #include<iostream> using namespace std; voidfun(int &r) { r*=2; } int main() { int n=50; fun(n); cout<<n<<end1; return 0; }
A.0
B.20
C.50
D.100
第5题:
以下程序的输出结果是#include "stdio.h"main(){ int a=065; printf("%d\n",--a);}
第6题:
有以下程序: #include <stdio.h>main( ){ int m =12,n=34; printf( "% d% d" ,m++ , ++n); printf("% d% d \n" ,n ++ , ++m); }程序运行后的输出结果是( )。
A.12353514
B.12353513
C.12343514
D.12343513
第7题:
下面程序的输出结果是( )。 #include<stdio.h> main() {char a[]={'a','b','c','d','f','g'},*p; p=a; printf("%c\n",*p+4); }
A.a
B.b
C.e
D.f
第8题:
下列程序的输出结果是( )。 #include<stdio.h> #include<string.h> main() { char a[]="\n123\\"; printf ("%d,%d\n",strlen(a),sizeof(a)); }
A.5,6
B.5,5
C.6,6
D.6,5
第9题:
以下程序的输出结果是 #include<stdio.h> main() { int a=15/b=21,m=0; switch(a%3) { case0:m++;break; case 1:m ++; switch(b%2) { default:m++; case 0:m ++;break;}} printf("%d\n",m);}
A.1
B.2
C.3
D.4
第10题:
下列程序的输出结果是( )。
#include<stdio.h>
#include<string.h>
main()
{ char a[]="\n123\\";
printf("%d,%d\n",strlen(A) ,sizeof(A) );
}
A.5,6
B.5,5
C.6,6
D.6,5
第11题:
下列程序的输出结果是______。#include <stdio.h>main (){ printf("%d\n",NULL);}
A.不确定(因变量无定义)
B.0
C.-1
D.1
第12题:
以下程序的输出结果是【 】。
include <stdio.h>
main()
{ int n=12345, d;
while(n!=O){ d=n%10; printf("%d",d); n/=10; }
第13题:
下面程序:#include“stdio.h“#includestdlib.hfut(int**s,intp[2][3]){**s=p[1][1];}voidmain(){inta[2][3]={1,3,5,7,9,11},*p;p=(int*)malloc(sizeof(int));fut(printf(“%d\n“,*p);getch();}输出结果是()
A、1
B、7
C、9
D、11
第14题:
下面程序的输出结果是______。 #include<stdio.h> main() { char *p[]="BOOL","OPK","H","SP"}; int i; for(i=3;i>=0;i-,i-) printf("%c",*p[i]); printf("\n"); }
A.SO
B.SP
C.SPOPK
D.SHOB
第15题:
下列程序的输出结果是【 】。
include <stdio.h>
void swap(int *a, int *B)
{
int *t;
t=a;a=b;b=t;
}
main()
{
int i=3,j=5,*p=&i,*q=&j;
swap(p,q);printf("%d %d\n",*p,*q);
}
第16题:
下列程序的输出结果是 #include"stdio.h" #define M(x,y) x%y main() { int a,m=12,n=100; a=M(n,m); printf("%d\n",a--);}
A.2
B.3
C.4
D.5
第17题:
下列程序舶输出结果是【 】。
include <stdio.h>
main()
{
int a[5]={2,4,6,8,10},*p;
p=a;p++;
printf("%d",*p);
}
第18题:
下列程序的输出结果是( )。 #include<stdio.h> #include<string.h> main() { char a[]="\n123\\"; printf("%d,%d\n",strlen(a),sizeof(a)); }
A.5,6
B.5,5
C.6,6
D.6,5
第19题:
有以下程序: #include<stdio.h> main() {inta[]={1,2,3,4},y,*p=&a[3]; --p;y=*p;printf("y=%d\n",y); } 程序的运行结果是( )。
A.y=0
B.y=1
C.y=2
D.y=3
第20题:
下面程序的输出结果是 ( ) # include<stdio.h> # include<string.h> { char * p1="abc" , * p2=" ABC ",str[50]="xyz"; strcpy(str+2.strcat (pi,p2)); printf("%s\n",str);}
A.xyzabcAB
B.zabcABC
C.yzabcABC
D.xycbcABC
第21题:
下列程序的输出结果是( )。
#include<stdio.h>
main()
{ int a=4;
printf("%d\n",(a+=a-=a*A) );
}
A.-8
B.14
C.0
D.-24
第22题:
下列程序的输出结果是( )。 #include<stdio.h> main() { int a=4; print f("%d\n", (a+=a-=a*a)); }
A.-8
B.14
C.0
D.-24
第23题:
阅读下面语句,则程序的执行结果是______。
include"stdio.h"
main()
{ inta=-1,b=1,k;
if((++a<0)&&! (b--<=0))
printf("%d,%d\n",a,b);
else printf("%d,%d\n",b,a);}
第24题:
5
6
8
9