Advertisement
Michal_Pilarski

zad3

Mar 19th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int wartoscbezwzgledna(int a)
  5. {
  6.     if(a<0)
  7.     {
  8.         a = -a;
  9.  
  10.     }
  11.     return a;
  12. }
  13.  
  14. int main()
  15. {
  16.     int b;
  17.     cout << "Podaj liczbe calkowita" << endl;
  18.     cin >> b;
  19.     cout<<wartoscbezwzgledna(b);
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement