Kacper_Michalak

Seria 2 Zadanie 17

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