Created
May 25, 2020 20:43
-
-
Save fuwiak/e73298b3438eaa66e7123eff0f439389 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
int wartosc_bezwgledna(int x){ | |
if(x>=0) | |
return x; | |
else | |
return -x; | |
} | |
int main(){ | |
int liczba1; | |
int liczba2; | |
liczba1=-9; | |
liczba2=77; | |
cout <<"wartosc bezwgledna z liczby "<< liczba1 <<" wynosi " << wartosc_bezwgledna(liczba1) << endl; | |
cout <<"wartosc bezwgledna z liczby "<< liczba2 <<" wynosi " << wartosc_bezwgledna(liczba2) << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment