CJCoding With Joseph

Running Maximum

The array {3, 1, 4, 1, 5, 9, 2} is given. Print, for each position, the maximum seen so far from the start up to that position, separated by single spaces:

3 3 4 4 5 9 9

There is no trailing space.

Expected Output:

3 3 4 4 5 9 9
Topics:
Arrays
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.