下面程序的运行结果是_____和_____。
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;
}
第1题:
下面程序的输出结果是【 】。
define MIN(a,b) (((a)<(b))?a:b)
include <iostream.h>
void main()
{
int x= 3, y=5;
cout<< MIN(x,y)<<end1;
}
第2题:
(36)有以下程序
#include <stdio.h>
#define PT 3.5;
#define S(x) PT*x*x;
main()
{ int a=1, b=2; printf(“%4.1f\n”,S(a+b));}
程序运行后输出的结果是
A)14.0 B)31.5 C)7.5 D)程序有错无输出结果
第3题:
下面程序由两个源文件 t4.h 和 t4.c 组成,程序编译运行的结果是 【 18 】 。
t4.h 的源程序为:
#define N 10
#define f2(x) (x*N)
t4.c 的源程序为:
#include <stdio.h>
#define M 8
#define f(x) ((x)*M)
#include "t4.h"
main()
{ int i,j;
i=f(1+1); j=f2(1+1);
printf("%d %d\n",i,j);
}
第4题:
下面程序的运行结果是【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);
}
第5题:
下列程序的输出结果是( )。
#include<stdio.h>
#define F(x)2.84+x
#define w(y)printf("%d",(int)(y))
#define P(y)w(y)putchar('\n')
main()
{ int x=2;
P(F(5) *x);
}
A.12
B.13
C.14
D.16
第6题:
有以下程序 #include <stdio.h> #define N 5 #define M N+1 #define f(x) (x*M) main() { int i1,i2; i1=f(2) i2=f(1+1); printf("%d %d\n",i1,i2); } 程序的运行结果是______。
A.12 12
B.11 7
C.11 11
D.12 7
第7题:
以下程序运行后,输出结果是 #define PT 5.5 #define S(x) PT*x*x #include<stdio.h> main() { int a=1,b=2; printf("%4.1f\n",s(a+b));}
A.49.5
B.9.5
C.22
D.45.0
第8题:
有以下程序
#include <stdio.h>
#define PT 3.5 ;
#define S(x) PT*x*x ;
main()
{ int a=1, b=2; printf("%4.1f\n",S(a+b));}
程序运行后的输出结果是
A)14.0
B)31.5
C)7.5
D) 程序有错无输出结果
第9题:
以下程序运行后,输出结果是 #define PT 5.5 #define S(x)PT* x * x main() {int a=1,b=2; printf("%4.lf\n",S(a+b); }
A.49.5
B.9.5
C.22
D.45
第10题:
以下程序的运行结果是( )。 define A 4 define B(x)A*x/2 main() {float c,a=8.0; c=B(A; printf("%f\n",C); }