Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void zamiana (int *x, int *y)
- {
- int z = *x;
- *x = *y;
- *y = z;
- }
- int main()
- {
- int a;
- int b;
- cout << "Podaj wartosc a: " << endl;
- cin >> a;
- cout << "Podaj wartosc b: " << endl;
- cin >> b;
- cout << "Przed zmina wartosc a wynosi " << a << ", natomiast wartosc b wynosi " << b << endl;
- zamiana(&a, &b);
- cout << "a = " << a << endl;
- cout << "b = " << b << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement