Code:
main(void)
{
int i, j, k, m, n, p[2][3], q[2][3], r[2][3];
for(i = 0; i < 2; ++i)
for(j = 0; j < 3; ++j)
{
m = i + 3;
n = j + 2;
k = m%n;
p[i][j] = i + j;
q[i][j] = k;
}
for(i = 0; i < 2; ++i)
for(j = 0; j < 3; ++j)
printf("%i, %i\n", p[i][j], q[i][j]);}
so i see when the loop starts i = 0 j = 0 making the output p=0 q = 1
then when the loop is i=1 j = 0 i see the output being 1 and 0
but the next line of output is p=2 q=3 when i = 1 and j = 1. p = i+j which is 2... okay. k is 4%3 which is 1? not 3?
output:
0,1
1,0
2,3
1,0
2,1
3,0
maybe im not getting this right..