Walk One Row of a 3x4 Grid
easyQuestion 439The 2D array grid has 3 rows of 4 ints, and the pointer row walks row 1, which is {5, 6, 7, 8}. Inside the loop print a SPACE followed by the value — printf(" %d", ...) — and also add that value into sum. The label "Row 1:" and the final newline are already printed for you.
Expected output
Row 1: 5 6 7 8 Row sum: 26
= 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.