下面程序的运行结果是()。 #define DOUBLE(r) r*r main( ) { int a=1,b=2,temp; temp=DOUBLE(a+b); printf(“%d/n”,temp); }
第1题:
下面程序的运行结果是【17】。
#define N 10
#define s(x)x*x
#define f(x)(x*x)
main()
{ int i1,i2;
i1=1000/s(N); i2=1000/f(N);
printf("%d %d\n",i1,i2);
}
第2题:
程序中头文件type1.h的内容是( )。 #define N 5 #define M1 N*3 程序如下: #define "type1.h" #define M2 N*2 main() { int i; i=M1+M2; printf("%d\n",i); } 程序编译后运行的输出结果是( )。
A.10
B.20
C.25
D.30
第3题:
下面程序的运行结果是 #include"iostream.h" #define sum(a,b) a*b void main( ) { int x; x=sum(1+2,3); cout<<x; }
A.0
B.9
C.7
D.5
第4题:
下面程序和运行运行结果是【 】。
define N 10
define s (x) x * x
define f(x) (x * x)
main( )
{ iht i1,i2;
i1 = 1000/s(N); i2 = 1000/f(N);
printf("%d %d\n",i1,i2);
}
第5题:
以下程序的运行结果是( )。 define S(x)x*x main() {int k=1; while(k<=4) {printf("%d,",S(k)); k++;}
第6题:
有以下程序#include <stdio.h>#define P 24;#define S(x) P*x+x;main(){ int a=2, b=2; printf("%d\n",S(a+b));}程序的运行结果是A.程序编译运行时报错,无法输出 B.54 C.96 D.100
第7题:
程序中头文件typel.h的内容是: #define N 5 #define M1 N *3 程序如下: #include“typel.h” #define M2 N*2 main() { int i; i=M1+M2;Printf(“%d\n”,0; } 程序编译后运行的输出结果是:
A.10
B.20
C.25
D.30
第8题:
下面的程序输出结果是( )。 #define U 5 #define V U+1 #define W V*V/2 main() {printf("%d ",W); printf("%d",5*W); }
A.18 72
B.10.5 52.5
C.10.5 25.5
D.10 30
第9题:
若有如下程序; #define X 3 #define Y X+1 #define Z Y*Y/2 main() { int n; for(n=1;n<=Z;n++) printf("%d",n); } 则程序运行后的输出结果是( )
A.12345
B.1234567
C.12345678
D.123456
第10题:
A.22
B.41
C.100
D.121
第11题:
12
13
15
11
第12题:
3
5
7
9
第13题:
以下程序的运行结果是( )。 define A 4 define B(x)A*x/2 main() {float c,a=8.0; c=B(A; printf("%f\n",C); }
第14题:
下面程序的运行结果是( )。 define POW(r)r*r main() {int x=2,y=3,t; t=POW(x+y); printf("%d\n",t); }
第15题:
程序中头文件type1.h 的内容是#define N 5#define M1 N*3程序如下:#define "type1.h"#define M2 N*2main (){ int i; i=M1+M2; printf("%d\n", i);) 程序编译后运行的输出结果是( )。
A.10
B.20
C.25
D.30
第16题:
下列程序的运行结果是______。
define POWER(x) ((x)*(x))
main ()
{ int i=1;
printf("%d,%d",POWER(i++),i);
}
第17题:
下面的程序输出结果是 ______。 #define r 16 #if r==16 void p(int a) { printf("%x",a) ; } #else void p(int a) { printf("%d",a) ; } #endif main() { p(32); }
A.32
B.20
C.编译时错误
D.运行时错误
第18题:
下面程序的运行结果是( )。
define EXCH(a,B){int t;t=a;a=b;b=t;}
main()
{int x=1,y=2;
EXCH(x,y);
printf("x=%d,y=%d\n",x,y);
}
第19题:
下面程序的输出结果是( )。 #define PI 3.1415 #define ARE(X) PI*x*x main() { int r=2; printf("%.2f",ARE(r+1)); }
A.28.26
B.28.26
C.9.28
D.9.28
第20题:
下面程序的输出结果是( ) #define PI 3.1415 #define ARE(x) PI*x*x main () {int r=2; printf("%f",ARE(r+1)); }
A.28.26
B.28.26
C.9.28
D.9.28
第21题:
程序中头文件typel.h的内容是 #define N 5 #define M1 N*3 #define "typel .h" #define M2 N*2 main ( ) { int i; i=M1+M2; printf ("%d\n", i ); } 程序编译后运行的输出结果是
A.10
B.20
C.25
D.30
第22题:
下面程序的运行结果是_____和_____。
include<iostream.h>
define N 10
define s(x) x * x
define f(x) (x * x)
void main( )
{ int i1,i2;
i1=1000/s(N) ;i2=1000/f(N) ;
cout < < i1 < < " " < < i2;
}
第23题:
8
9
5
6