How do you return 2 numbers in one function? Thanks for answering.
#include <iostream>
using namespace std;
int swap(int &, int &);
int main () {
int a, b;
cout << "Please input 2 numbers" << endl;
cin >> a >> b;
cout << "The 2 numbers swapped are " << swap(a, b) << endl;
return 0;
}
int swap(int &x, int &y) {
int t = x;
x = y;
y = t;
return x;
return y;
}