Advertisement
wiktormadera

zad14

Apr 2nd, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void ZAMIANA(float &a, float &b)
  6. {
  7.     float c;
  8.     c=a;
  9.     a=b;
  10.     b=c;
  11. }
  12. int main()
  13. {
  14.     float a,b;
  15.     cout << "Podaj a: " << endl;
  16.     cin >> a;
  17.     cout << "Podaj b: " << endl;
  18.     cin >> b;
  19.     ZAMIANA(a,b);
  20.     cout << "Teraz a wynosi: " << a << endl;
  21.     cout << "Teraz b wynosi: " << b << endl;
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement