← Back to Pointers
Question 439
Walk One Row of a 3x4 Grid
Walk One Row of a 3x4 Grid
The 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 — 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.