设变量s已定义,要若表达式s=3.14*3*3与s=PI*3*3等价(其中PI为宏名),则对PI正确的宏定义为()A.#define PI 3.14B.#define PI 3.14;C.#define PI = 3.14D.define PI 3.14E.define PI = 3.14;F.define PI 3.14;
设变量s已定义,要若表达式s=3.14*3*3与s=PI*3*3等价(其中PI为宏名),则对PI正确的宏定义为()
A.#define PI 3.14
B.#define PI 3.14;
C.#define PI = 3.14
D.define PI 3.14
E.define PI = 3.14;
F.define PI 3.14;
参考答案和解析
#define PI 3.14
相关考题:
以下程序的功能是:给r输入数据后计算半径为r的圆面积s。程序在编译时出错。main()/* Beginning */{ int r; float s; scanf("%d",r); s=*PI*r*r; printf("s=%f\n",s);}若想纠正错误,应该( )。 A)更改注释语句书写位置 B)存放圆半径的变量r应该定义为整型C)输出语句中不能加“s=” D)给计算面积的PI变量赋值
(13)为把圆周率的近似值 3.14159 存放在变量 pi 中,应该把变量 pi 定义为( )。A)Dim pi As IntegerB)Dim pi(7) As IntegerC)Dim pi As SingleD)Dim pi As Long
为把圆周率的近似值3.14159存放在变量pi中,应该把变量pi定义为A.Dim pi As IntegerB.Dim pi(7)As IntegerC.Dim pi As SingleD.Dim pi As Long
过期妊娠时检测脐带血流,当PI或S/D比值在下列哪种情况下,提示胎盘功能下降A、PI增大,S/D比值增大B、PI增大,S/D比值减小C、PI减小,S/D比值增大D、PI减小,S/D比值减小E、PI值不变,S/D比值减小
下面宏定义正确的是( )A.#define S a*bB.#define PI 3.14;C.#define max(a,b) ((a) >(b) ?(a) ;(b) )D.#define s(x) (x)*(x);
请把下面程序补充完整,正确答案是( )。 main( ) { float radius,length,area,volume; printf("Input a radius:"); Scanf("%f",radius); length=2.0*PI*radius; /*引用无参宏求周长*/area=PI*radius*redius; /*引用无参宏求而积*/ volume=PI*radius*radius*radius*3/4; /*引用无参宏求体积*/ printf("length=%.2f,area=%.2f,volume=%.2f\n",length,area,volume); }A.PI=3.1415926B.Const PI=3.14159C.#define PI3.1415926D.Float PI=3.14159
某航空公司机票销售系统有n个售票点,该系统为每个售票点创建一个进程Pi(i=1,2,,n)管理机票销售。假设Tj(j=1,2,,m)单元存放某日某航班的机票剩余票数,Temp为Pi进程的临时工作单元,x为某用户的订票张数。初始化时系统应将信号量S赋值为( )。Pi进程的工作流程如下图所示,若用P操作和V操作实现进程间的同步与互斥,则图中空(a),空(b)和空(c)处应分别填入( )。A.0B.1C.2D.3A.P(S),V(S)和V(S)B.P(S),P(S)和V(S)C.V(S),P(S)和P(S)D.V(S),V(S)和P(S)
当执行下列宏定义命令后,S的值为 ( ) # defineR3.0 # define PI 3.1415926 # define L2 * PI * R # define S PI * R * RA.3.1415926B.18.849556C.3D.28.2743334
设实型变量pi已赋值为3.14159,下面不能输出3.14的语句是()A、write(pi:0:2)B、writeln(pi:1:2)C、write(pi:2:2)D、writeln(pi:2)
Float pi = new Float(3.14f); if(pi3) { System.out.print(”pi is bigger than 3. “); } else { System.out.print(”pi is not bigger than 3. “); } finally { System.out.println(”Have a nice day.”); } What is the result?() A、 Compilation fails.B、 pi is bigger than 3.C、 An exception occurs at runtime.D、 pi is bigger than 3. Have a nice day.E、 pi is not bigger than 3. Have a nice day.
对于在代码中经常要用到的且不会改变的值,可以将其声明为常量。如圆周率PI始终为3.14。现在要声明一个名为PI的圆周率常量,下面哪段代码是正确的()。A、const float PI;PI=3.14f;B、const float PI=3.14f;C、float const PI;PI=3.14f;D、float const PI=3.14f;
单选题为把圆周率的近似值3.14159存放在变量pi中,应该把pi定义为( )。ADim pi As IntegerBDim pi(7)As IntegerCDim pi As SingleDDim pi As Long
单选题Float pi = new Float(3.14f); if(pi3) { System.out.print(”pi is bigger than 3. “); } else { System.out.print(”pi is not bigger than 3. “); } finally { System.out.println(”Have a nice day.”); } What is the result?()A Compilation fails.B pi is bigger than 3.C An exception occurs at runtime.D pi is bigger than 3. Have a nice day.E pi is not bigger than 3. Have a nice day.