Top

Discussion

What will be the output of the program?

#include
#define SWAP(a, b) int t; t=a, a=b, b=t;
int main()
{
    int a=10, b=12;
    SWAP(a, b);
    printf("a = %d, b = %d\n", a, b);
    return 0;
}

 

  • A.a = 10, b = 12
  • B.a = 12, b = 10
  • C.Error: Declaration not allowed in macro
  • D.Error: Undefined symbol 't'

Answer: B

No answer description available for this question.

No comment is present. Be the first to comment.
Loading…

Post your comment