โ Back to If Statements
Question 330
Absolute Value (No Input)
Absolute Value (No Input)
Create anintvariablenumberset to-7. Using anifstatement, compute its absolute value into a variableresult: ifnumberis negative, setresultto-number. Then print exactly: The absolute value is 7
Expected Output:
The absolute value is 7
Topics:
If Statements
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.