正在加载图片...
第二部分¢语言程序设计同步训练 3.以下程序在宏展开后,赋值语句s的形式是 #define R 3.0 #define PI 3.14159 i fle printf(s=f\n”,s) 4.以下程序的输出结果是 #define DEBUG main() inta-14,b=15,c; #ifdef DEBUG #endif printf("c=dln”,c) 选择题 1.以下程序的运行结果是( #define MIN(x, y) (x)<(y )?(x):(y) i int i=10,j-15,k k=10*MIN(1,j); printf("d\n”,k) 程序段: ((A+1)*a) 正确的判断是( A)程序错误,不许嵌套宏定义 C)x=21 D)程序错误,宏定义不许有参数 3.以下程序段中存在错误的是()。 A)#define array size 100 int array [array size B)#define PI 3. 1415926 #define s(r) PI*(r)*(r)第二部分 C 语言程序设计同步训练 ·227· ·227· 3. 以下程序在宏展开后,赋值语句 s 的形式是______________。 #define R 3.0 #define PI 3.14159 main() { float s; s=PI * R * R ; printf( “s=%f\n”, s); } 4. 以下程序的输出结果是__________。 #define DEBUG main() {int a=14,b=15,c; c=a/b; #ifdef DEBUG printf(“a=%d,b=%d,”,a,b); #endif printf(“c=%d\n”,c); } 二、选择题 1. 以下程序的运行结果是( )。 #define MIN(x,y) (x)<(y)?(x):(y) main() { int i=10,j=15,k; k=10*MIN(i,j); printf(“%d\n”,k); } A) 10 B) 15 C) 100 D) 150 2. 程序段: #define A 3 #define B(a) ((A+1)*a) … x=3*(A+B(7)); 正确的判断是( )。 A) 程序错误,不许嵌套宏定义 B) x=93 C) x=21 D) 程序错误,宏定义不许有参数 3. 以下程序段中存在错误的是( )。 A) #define array_size 100 int array[array_size]; B) #define PI 3.1415926 #define S(r) PI*(r)*(r) …
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有