Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void zamien (int *a, int *b)
- {
- int pom=*a;
- *a=*b;
- *b=pom;
- }
- int main()
- {
- int a,b;
- cout<<"Wprowadz dwie liczby:"<<endl; cin>>a>>b;
- zamien(&a,&b);//przekazujemy adresy zmiennych
- cout <<a<<" "<<b<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment