← Back to Arrays
Question 218
Largest Element in an Array
Largest Element in an Array
To find the biggest value in an array, assume the first element is the largest so far, then compare it against every other element. Whenever you find something bigger, remember that new value. After checking the whole array you will have the maximum. Print 'Max: ' followed by the largest number.
Expected Output:
Max: 9= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics:
Arrays
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.