📚 Question Bank Q16 — Programming and Data Structure
Tags
Programming and Data Structure
Q16. Marks: +2.0 UGC NET Paper 2: Computer Sc 23rd August 2024 Shift 1
#include < iostream.h >

using namespace std;

void swap(int &x, int &y) {
    int temp = x;
    x = y;
    y = temp;
}

int main() {
    int a = 5, b = 10;
    swap(a, b); 
    swap(a, b); 
    cout << a << " " << b; 
    return 0;
}

What will be the output of above code?

1.5, 10 ✓ Correct
2.10, 5
3.5, 5
4.10, 10
📄 All “Programming and Data Structure” questions across papers
🏷 Change Tag for this Question