Function Calls

Q

What will be printed as the result of the operation below:

          #define swap(a,b) a=a+b;b=a-b;a=a-b;
          void main() {
              int x=5, y=10;
              swap (x,y);
              printf("%d %d\n",x,y);
              swap2(x,y);
              printf("%d %d\n",x,y);
          }
          int swap2(int a, int b) {
              int temp;
              temp=a;
              b=a;
              a=temp;
              return 0;
          }

✍: FYIcenter

A
The correct answer is
10, 5
5, 10

2007-02-26, 6520👍, 0💬