← Arrays & Pointer Arithmetic

Array Sum

easy

Read a count n, then n integers into the values array (already done for you), and print their sum in the form Sum: 10.

This is the array-indexing warm-up before the next two exercises push into pointer traversal. values[i] and *(values + i) compute the exact same address, as covered in the lesson – use whichever reads more naturally here; you’ll be asked to use the pointer form explicitly in the next exercise.

Your solution

"Run" uses the sample stdin ("4\n1 2 3 4"). "Submit" checks your code against all 3 test cases.

Test results

Submit your solution to run it against all test cases.

Hints

    Reference solution