← Problem book: C
Lesson 85 of 96 · 10 XP
Function: absolute value
Theory and problem statement
Machine translation, not yet reviewed by a native speaker.
Write a function my_abs(x) that returns the absolute value of a number (the number without the minus sign). Don't use the built-in abs. Read an integer and print its absolute value.
Example
Input:
-5
Output:
5
Sign up for free to solve this task right in your browser: code editor, running, test checks and hints.