Multiple choice technology programming languages

What will be the output of the following program : #define Swap if (a != b) { \ temp=a; \ a = b; \ b = temp; \ //Swapping Done } void main() { int a=10,b=5,temp; Swap; printf("a=%d a=%d",a,b); }

  1. Compile-Time Error

  2. a=5 b=10

  3. a=10 b=5

  4. None of the above

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

The macro definition has malformed backslashes - they should only appear at line endings for continuation, not before each statement. Also, the macro call 'Swap;' lacks proper syntax. The preprocessor will fail to parse this correctly, resulting in a compilation error.