CJCoding With Joseph

Absolute Value (No Input)

Create an int variable number set to -7. Using an if statement, compute its absolute value into a variable result: if number is negative, set result to -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.