Course Solutions Uncategorized (Solved) : 1 4 7 10 2 5 8 11 3 6 9 12 Want Print Matrix C Language Formula Come 3 J 1 Include Int Mai Q34209684 . . . .

(Solved) : 1 4 7 10 2 5 8 11 3 6 9 12 Want Print Matrix C Language Formula Come 3 J 1 Include Int Mai Q34209684 . . . .

 

1 4 7 10
2 5 8 11
3 6 9 12

I want to print this matrix in c language.

How did this formula come out? (3 * j + i + 1);

#include <stdio.h>

int main()
{
int y[3][4];
int i, j;
for (i = 0; i < 3; i++)
{
for (j = 0; j < 4; j++)
printf(“%d “, 3 * j + i + 1);
printf(“n”);
}
return 0;
}

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post