CJCoding With Joseph
15free / daySign inCreate account

Sum Five Scores Through a Pointer

Read 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 — print one after the last line.

Hints2 available
Topics:
Pointers
📥 Auto-Input:
10 20 30 40 50\n
This input is automatically fed to your program's stdin
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.