What will be the program's output? #include #define MIN(x, y) (x 0) printf("percent dn", z); return 0;
A. 3
B. 4
C. 0
D. no output
Answer:A
What will be the program's output? #include #define MIN(x, y) (x 0) printf("percent dn", z); return 0;
A. 3 B. 4 C. 0 D. no output
Explanation: The macro MIN(x, y) (x z = (x+y/2 y-1)? x+y/2 = y – 1; => z = (3+4/2 4-1)? 3+4/2 = 4 – 1; => z = (3+2 4-1)? 3+2 = 4 – 1; => z = (5 3)? 5: 3; The macro returns the number 3 and stores it in the variable z. Step 3: if(z > 0) becomes if(3 > 0), indicating that the if condition is met. It runs the if block statements. Step 4: printf("percent dn", z); It outputs the value of variable z. As a result, the program's output is 3.