diff --git a/Swap-without-third-variable/06. Changing variable after copying it.cpp b/Swap-without-third-variable/06. Changing variable after copying it.cpp new file mode 100644 index 0000000..23fa824 --- /dev/null +++ b/Swap-without-third-variable/06. Changing variable after copying it.cpp @@ -0,0 +1,22 @@ +#include + +using namespace std; + +int swap(int &a, int&b) { + b = a; + return 0; +} + + + +int main() { + int a = 5; + int b = 50; + + + a = b + swap(a,b); + + cout << a << " " << b << endl; + + return 0; +}