โ Back to Arrays
Question 387
Largest Absolute Value
Largest Absolute Value
The array{3, -7, 2, -9, 4}is given. Find the largest absolute value (magnitude) among the elements and print it: 9 The magnitudes are3,7,2,9,4, so the answer is9. UseMath.absand print the magnitude, not the original signed value.
Expected Output:
9
Topics:
Arrays
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.