Complete the code to initialize the starting row index for spiral traversal.
int top = [1];The top row index starts at 0 because array indices in C start from 0.
Complete the code to move the left boundary right after traversing the left column.
left[1];After traversing the left column, we move the left boundary right by incrementing it.
Fix the error in the loop condition to traverse the top row from left to right.
for (int i = left; i [1]= right; i++) { printf("%d ", matrix[top][i]); }
The loop should include the right boundary, so use <= to go from left to right inclusive.
Fill both blanks to correctly traverse the right column from top to bottom.
for (int i = [1]; i [2] bottom; i++) { printf("%d ", matrix[i][right]); }
Start from the row below top (top + 1) and go up to bottom inclusive (using <=).
Fill all three blanks to correctly traverse the bottom row from right to left.
for (int i = [1]; i [2] [3]; i--) { printf("%d ", matrix[bottom][i]); }
Start from one left of right (right - 1), go while i is greater than or equal to left, decrementing i.
