Sum Five Scores Through a Pointer
easyQuestion 434Read 5 whole numbers from input into the array scores (that loop is already written for you). A pointer p already points at scores[0].
In the second loop, add the value at *(p + i) into total. Then the program prints the total on one line.
For the input: 10 20 30 40 50
The output for that input is shown in Expected Output.
Expected output
Total: 150= newline. The output ends with a newline, so 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.