Read a row-major map in both directions

Trace the updates and give the exact output. Draw the row-major sequence of all six values after the updates. If B is the byte address of grid[0][0] and S=sizeof(int), give the byte-address formula for grid[r][c] and the offset of grid[1][2]. An element has row-major element offset 4: identify its row and column. Explain why the multiplier is three rather than two; no numeric int byte size is supplied.

#include <stdio.h>
int main(void) {
    int grid[2][3] = {{1, 2, 3}, {4, 5, 6}};
    for (int r = 0; r < 2; ++r) {
        for (int c = 0; c < 3; ++c) {
            grid[r][c] += 10 * r + c;
        }
    }
    for (int r = 0; r < 2; ++r) {
        for (int c = 0; c < 3; ++c) {
            printf("(%d,%d)=%d offset=%d\n", r, c, grid[r][c], r * 3 + c);
        }
    }
    return 0;
}

