Consider the following C program snippet:

void swap(int x, int y);

int main() {

    int a = 10, b = 20;

    swap(a, b);

    printf("%d %d", a, b);

    return 0;

}

void swap(int x, int y) {

    x = x + y;

    y = x - y;

    x = x - y;

}

Which of the following is TRUE?

1
Considering call by value, output is: 20 10
2
Considering call by reference, output is: 20 10
3
Considering call by value, output is: 10 20
4
Considering call by reference, output is: 10 20

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation