Practice
Absolute Value
EASYSelection
Read an integer. Output its absolute value (i.e. always non-negative).
Input: A single integer. Output: The absolute value.
Example:
Input: -5
Output: 5
Premium is coming soon. All grading features are currently unlocked.
Sample Test Cases
Test 1: Negative input
Inputs: -5
Expected: 5
Test 2: Positive input
Inputs: 3
Expected: 3
Test 3: Zero
Inputs: 0
Expected: 0
Ctrl+Enter
Press Ctrl+Enter to run your code
or Ctrl+Shift+Enter to grade