Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- void swap(int &x, int &y)
- {
- int temp = x;
- x = y;
- y = temp;
- }
- int main()
- {
- int a = 10;
- int b = 40;
- swap(a, b);
- cout << a << " " << b << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement