-2

I have this program

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int i;
    int a[][3]={{1,2,3},{4,5,6},{7,8,9}};
    printf("\  Elements of an array with their address\n");
    for(i=0;i<9;i++)
    {
        printf("%8u",&a[0][0]+i);
        printf("[%d]",*(&a[0][0]+i));
        if(i==2 || i==5)
            printf("\n");
    }

}

Can you please explain why (if(i==2 || i==5) is used , I am really confused in this step. Thanks In Advance.

4

2 に答える 2