以下程序的输出结果是【 】。 define MCNA(m)2*m define MCNB(n m)
以下程序的输出结果是【 】。 define MCNA(m)2*m define MCNB(n, m)2*MCRA(n)+m define f(x)(x*x) main() { int i=2, j=3; printf("% d/n", MCRB(j, MCRA(i))); }
请帮忙给出正确答案和分析,谢谢!
参考解答
正确答案:16
本题定义了两个宏MCRA(m)和MCRB(n,m),展开宏MCRB(n,m),得到:MCRB(j,MCRA(i)=2*MCRA(j)+MCRA(i)=2×2×j+2×i=4×3+2×2=12+4=16,因此printf函数的输出结果为16。
相似问题
下面程序的功能:将字符数组a中下标值为偶数的元素从小到大排列 其他元素不变。请填空。 include
下面程序的功能:将字符数组a中下标值为偶数的元素从小到大排列,其他元素不变。请填空。 include<stdio h> include<string h> main() { ch
有以下程序: void f(int*x iht * y) { int t; t=*x;*x;=*y;
有以下程序: void f(int*x,iht * y) { int t; t=*x;*x;=*y;*y=t; } main() { int a[8]={1,2,3,4,5,6,7,8},i,*p,*q; p=a;q=&a[7]; while(
以下程序的运行结果是【 】。 include <stdio.h> main() { int x=1
以下程序的运行结果是【 】。 include <stdio.h> main() { int x=1,y=0,a=0,b=0; switch(x) { case 1: switch(y) { case 0:a++
若a=1 b=2 则表达式!(x=a)‖(y=b)&&0的值是______。请帮忙给出正确答案和分析
若a=1,b=2,则表达式!(x=a)‖(y=b)&&0的值是______。请帮忙给出正确答案和分析,谢谢!
以下程序的功能是输出如下形式的方阵: 13 14 15 16 9 10 11 12 5 6 7 8
以下程序的功能是输出如下形式的方阵: 13 14 15 16 9 10 11 12 5 6 7 8 1 2 3 4 请填空。 main() { int i, j, x; for(j=4; j
