Multiple choice

#define big(a,b) a > b ? a : b #define swap(a,b) temp=a; a=b; b=temp; void main() { int a=3,b=5,temp=0; if ((3+big(a,b)) > b) swap(a,b); printf("%d %d",a,b); }

  1. 3 0

  2. 5 3

  3. 3 5

  4. 5 0

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The macro big(a,b) returns the larger value, so big(3,5) returns 5. The condition (3+5)>5 evaluates to true (8>5). When swap(a,b) expands, it executes temp=a; a=b; b=temp; making a=5 and b=3. The printf outputs "5 3". The key point is that the swap macro lacks braces, but it still executes sequentially.