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 = 30;
- swap(&a, &b);
- cout << a << " " << b << endl;
- }
Add Comment
Please, Sign In to add comment