下列程序的输出结果是( )。 #include<stdio.h> #defineF(x)2.84+x #define w(y) printf("%d",(int)(y)) #define P(y)w(y)putchar(’\n

admin2013-06-11  25

问题 下列程序的输出结果是(    )。    #include<stdio.h>    #defineF(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

答案1

解析 本题考查带参数的宏的定义及相关运算。P(F(5)*x)=P(2.84+5*2)=P(12.84),调用w(12.84),输出(int)(12.84)=12。
转载请注明原文地址:https://kaotiyun.com/show/2CJp777K
0

随机试题
最新回复(0)