Advertisement
Lukasz_Miskiewicz

Zadanie 3

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