diff options
Create exercise01.cpp
1 files changed, 11 insertions, 0 deletions
| -rw-r--r-- | Sem. 04/Solutions/exercise01.cpp | 11 |
diff --git a/Sem. 04/Solutions/exercise01.cpp b/Sem. 04/Solutions/exercise01.cpp new file mode 100644 index 0000000..edc9c9c --- /dev/null +++ b/Sem. 04/Solutions/exercise01.cpp @@ -0,0 +1,11 @@ +#include <iostream> +using namespace std; + +int mod(int n) +{ + return n < 0 ? -n : n; +} +int main() +{ + cout << mod(-4) << endl; +} |
