17,37
49,2401
17,289
49,289
第1题:
有以下程序:
include<stdio.h>
define S(x)4*(x)*x+1
main( )
{int k=5,j=2;
printf("%d\n",S(k+j));
}
程序运行后的输出结果是( )。
A.197
B.143
C.33
D.28
此程序考查带参数的宏定义,S(k+j)展开后即4*(k+j)*k+j+1,所以结果为l43,答案为B。
第2题:
以下程序运行后,输出结果是______。 #include<stdio.h> #define PT 5.5 #difine S(x) PT*x*x main() { int a=1,b=2; printf("%4.1f/n",S(a+b)); }
A.49.5
B.9.5
C.22
D.45
第3题:
执行下列程序后,输出的结果是( )。 #include<stdio.h> #define S(X) X*X void main() { int a=9,k=3,m=2; a/=S(k+m)/S(k+m); printf("%d",a); }
A.1
B.4
C.9
D.0
第4题:
有以下程序 #include<stdio.h> #define PT3.5; #define S(x)PT*x*x; main() { inta=1,b2; printf("%4.1f\n",S(a+b); } 程序运行后的输出结果是______。
A.14.0
B.31.5
C.7.5
D.程序有错无输出结果
第5题:
有以下程序
#include <stdio.h>
#define S(x) (x)*x*2
main( )
{ int k=5, j=2;
printf( "%d,”,s(k+j) ); printf(”%d\n”,s( (k-j) ) );
}
程序运行后的输出结果是
A) 98,18
B) 39,11
C) 39,18
D) 98,11
第6题:
有以下程序: #include<stdi0.h> #define S(x)(x)"x"2 main( ) { int k一5,j=2; Drintf("%printf,",S(k+j));printf("%printf\n",S((k—j))); } 程序运行后的输出结果是( )。
A.98,18
B.39,11
C.39,18
D.98,11
第7题:
若有以下程序
则程序的输出结果是
A.17,289
B.49,2401
C.17,37
D.49,289
第8题:
有以下程序:#include <stdio.h>void swap(char * x,ehar * y){ char t; t= *x; *x: *y; *y=t;main ( ){ char *s1 ="abc", * s2 ="123"; swap(s1 ,s2); printf("%s,%s \n" ,s1 ,s2);}程序执行后的输出结果是( )。
A.123,abe
B.abe,123
C.1bc,a23
D.321,cba
第9题:
以下程序的输出结果是______。 #include <string.h> main() { char*a="abcdefghi";int k fun(a);puts(a); } fun(char*s) { int x,y; char c for(x=0,y=strlen(s)-1;x<y:x++,y--) {c=s[y];s[y]=s[x];s[x]=c;} }
A.ihgfedcba
B.abcdefghi
C.abcdedeba
D.ihgfefghi
第10题:
0
1
4
8
第11题:
98,18
39,11
39,18
98,11
第12题:
0
10
30
64
第13题:
执行下列程序后,输出的结果是( )。 #include<stdio.h> #define S(X)X*X void main() { int a=9,k=3,m=2; a/=S(k+m)/S(k+m); printf("%d",a); }
A.(*p) .data.a
B.(*p) .a;
C.p->data.a
D.p.data.a
第14题:
以下程序的输出结果是( )。
include<stdio.h>
void fun(int x)
{ if(x/2>0)fun(x/2);
printf("%d",x);
}
main()
{fun(3);printf("\n");
}
第15题:
以下程序的输出结果是【 】。
include <stdio.h>
int fun(int x)
{ static int t=0;
return(t+=x);
}
main()
int s,i;
for(i=1 ;i<=5;i++) s=fun(i);
printf("%d\n",s);
第16题:
以下程序运行后,输出结果是______。 #define P4.5 #define S(x)P*x*x #include<stdio.h> main() { int a=2,b=3; printf("%.1f\n",S(a+b)); }
A.49.5
B.112.5
C.18
D.24
第17题:
以下程序运行后,输出结果是 ( ) # include<stdio.h> # define PT5.5 # define S (x)PT* x * x main( ) { int a=1,b=2; printf("%4.1f\n",s(a+b)); }
A.49.5
B.9.5
C.22
D.45
第18题:
有以下程序: #include <stdio.h> main() { union { charch[2]; int d; } s; s.d=0x4321; printf("%x,%x\n",s.ch[0],s.ch[1]); } 在16位编译系统上,程序执行后的输出结果是( )。
A.21,43
B.43,21
C.43,00
D.21,00
第19题:
下列程序的输出结果是______。#include <stdio.h>main(){ union { int k; char i[2]; } *S,a; s=&a; s->i[0]=0x39; s->i[1]=0x38; printf("%x\n",s->k);}
A.3839
B.3938
C.380039
D.390038
第20题:
执行下列程序后,输出的结果是( )。
#include<stdio.h>
#define S(X)X*X
void main()
{ iht a=9,k=3,m=2;
a/=S(k+m)/S(k+m);
printf("%d",A) ;
}
A.1
B.4
C.9
D.0
第21题:
(35)有以下程序
#include <stdio.h>
#define S(x) 4*(x)*x+1
main()
{ int k=5,j=2;
printf("%d\n",S(k+j));
}
程序运行后的输出结果是
A)197
B)143
C)33
D)28
第22题:
11,2
25,2
11,12
25,26
第23题:
197
143
33
28