KarolWozniak

Zadanie 14

Mar 31st, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int liczba1,liczba2;
  5.  
  6. void ZAMIANA(int a, int b)
  7. {
  8.     int c;
  9.     c=a;
  10.     a=b;
  11.     b=c;
  12.  
  13.     cout << "Wartosc a po zamianie wynosi: " << a << endl;
  14.     cout << "Wartosc b po zamianie wynosi: " << b << endl;
  15. }
  16.  
  17. int main()
  18. {
  19.     cout << "Podaj liczbe a: ";
  20.     cin >> liczba1;
  21.     cout << "Podaj liczbe b: ";
  22.     cin >> liczba2;
  23.     ZAMIANA(liczba1, liczba2);
  24.     return 0;
  25. }
Add Comment
Please, Sign In to add comment