#include <iostream>
/*void Swap (int *x, int *y) {
int temp = x;
*x = *y;
*y = temp;
}*/
void Swap(int&x, int&y) {
int temp = x;
x = y;
y = temp;
}
int main() {
using namespace std;
int a = 5, b = 10;
Swap(a, b);
cout << "a:" << a << "\n";
cout << "b:" << b << "\n";
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: