阅读下列程序段,则程序的输出结果为 #include"stdio.h" #define M(X,Y)(X)*(Y) #define N(X,Y)(X)/(Y) main() { int a=5,b=6,c=8,k; k=N(M(a,b),c); printf("%d\n",k);}
A.3
B.5
C.6
D.8
第1题:
阅读下列程序段,则程序的输出结果为 #include"stdio.h" #defineM(X,Y)(X)*(Y) #defineN(X,Y)(X)/(Y) main() {f int a=5,b=6,c=8,k; k=N(M(a,b),c); printf("%d\n",k);}
A.3
B.5
C.6
D.8
第2题:
以下程序段的执行结果为 #include<iostream.h> #define PLUS(X,Y)X+Y void main( ) { int x=1,y=2,z=3,sum; sum=PLUS(x+y,z) * PLUS(y,z); cout < <"SUM=" < < sum; cout< <end1;}
A.SUM=9
B.SUM=12
C.SUM=18
D.SUM=30
第3题:
阅读下面程序:
include<iostream.h>
void f(int n)
{
int x(5);
static int y(10);
if(n>0)
{
++x;
++y;
cout<<x<<","<<y<<endl;
}
}
void main()
{
int m(1);
f(m),
}
则该程序的输出结果是【 】
第4题:
有以下程序
#include <stdio.h>
#define F(X,Y) (X)*(Y)
main( )
{ int a=3, b=4;
printf("%d\n", F(a++, b++));
}
程序运行后的输出结果是
A.12
B.15
C.16
D.20
第5题:
阅读下列程序:
include<iostream.h>
void fun(int n)
{
int x(5);
static int y(10);
if(n>0)
{
++x;
++y;
cout<<x<<","<<y<<endl;
}
}
void main()
int m(1);
fun(m);
}
则该程序的输出结果是______。
第6题:
下列程序的输出结果是( )。
#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
第7题:
请选出以下程序段的输出结果______。 #include<stdio.h> #define MIN(x,y) (x)<(y)?(x):(y) main() { int i,j,k;i=10;j=15; k=10*MIN(i,j); printf("%d\n",k); }
A.15
B.100
C.10
D.150
第8题:
下列程序的输出结果是
#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
第9题:
以下程序的输出结果是______。 #include<stdio.h> #define FUDGE(y) 2.84+y #define PR(a) printf("%d",(int)(a)) #define PRINT1(a) PR(a);putchar('\n') main() { int x=2; PRINT1(FUDGE(5)*x); }
A.11
B.12
C.13
D.15
第10题:
下列程序的输出结果是( )。 #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