LogiQuest
Back to References
9

What will be the output of the program?

#include <iostream>
using namespace std;
void swapv(int &a, int &b) { int t = a; a = b; b = t; }
int main() {
    int x = 1, y = 9;
    swapv(x, y);
    cout << x << y << endl;
    return 0;
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.