c语言题(填空)

来源:百度知道 编辑:UC知道 时间:2024/06/07 10:59:00
(1)#define width 80
#define length width+40
则执行赋值语句:v=length*20;
(v为int型变量)后,v的值是_______
(2)以下程序的输出结果是_______
#define add(x) (x)+(x)
main()
{ int a=4,b=6,c=7;
int d=add(a+b)*c
print ("d=%d",d);}
(3)若输入60和13,下列程序运行结果为_________
#define surplus (a,b)((a)%(b))
mian()
{int a,b;scanf ("%d,%d",&a,&b);
printf("%d\n",surplus(a,b))
(4)下列程序的输出结果:_________
#define con 1 0
#define con 2 5
#include "stdio.h"
main()
{int x;
#ifdef con 1
x=con 1;
#else
x=con 2;
#endif
printf("%d\t",x)
if (con 1) x=con 1;
else x=con 2
printf (“%d\n”,x);}
(5)程序填空
#include“stio.h”
#define max(a,b)__________
main()
{ int i,j;
printf ("please input two num:\n")
scanf ("%d%d",_____________)
printf ("the max is %d\n",_________)

(1)880
(2)d=80
(3)输入两个数,求余数。结果为8
(4)0 5(0和5中间是个\t)
(5)
(a>b)?a:b
&i,&j
max(i,j)

880
80
8
0 5
a>b?a:b i,j max(i,j)

define 是把后面字符串的原封不动的代替前面的,做题时只要把字符串替换后再判断原来的代码

(1)80+40*20=880
(2)(a+b)+(a+b)*c=80
(3)8
(4)答案不确定,防止误人子弟,呵呵
(5)(a>b)?a:b
&i,&j;
max(i,j);

(1)880
(2)d=80
(3)输入两个数,求余数。结果为8
(4)0 5(0和5中间是个\t)
(5)
(a>b)?a:b
&i,&j
max(i,j)