← Back to Pointers
Question 437
Find the Highest Reading with a Roaming Pointer
Find the Highest Reading with a Roaming Pointer
Read 6 whole numbers from input into the array readings (that loop is already written). The variable max already holds the first reading, and the second loop moves a pointer p from readings + 1 up to the end of the array. Inside that loop, if the value p points at is greater than max, store it in max. The program then prints the largest value. For the input: 4 19 7 23 11 2 The output for that input is shown in Expected Output.
Expected Output:
Highest: 23= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
Pointers
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.