设有以下宏定义: #define S(x) x/x int a=4,b=3,area; 执行语句area=S(a+b);后,area的值为()
举一反三
- 若有宏定义 #define AREA(x) (x)*(x) 则表达式AREA(3+4)的值为:
- 以下程序的运行结果是( )。#define PI 3#define S(x) PI*x*xmain(){ int area; area=S(2+3); printf("%d ",area);} A: 27 B: 12 C: 15 D: 75
- 写出以下程序的输出结果为______。#define S(r) r*r void main(){int a=4,b=6; int area;area=S(a+b);printf(“area=%d”,area); } A: 100 B: 28 C: 24 D: 34
- 若有宏定义:#define s(x) x*x,则表达式s(2+1)的值为 A: 9 B: 4 C: 5 D: 6
- 阅读下面程序,程序的运行结果是( )。public class Example {public static void main(String[] args) {int area = getArea(3, 5);System.out.println(" The area is " + area);}public static int getArea(int x, int y) {int temp = x * y; return temp; }} A: 编译错误 B: The area is 3 C: The area is 5 D: The area is 15