Here is my code:

I'm supposed to be displaying a sequential number matrix, first as a 4x5 (matrix_M) & then as a 5x4 (matrix_N). I also must transpose the numbers, so that the output looks like this:Code:#include <stdio.h> #define count 6 int transpose (int row[], int column[], int number[][6]) { number[row[count]][column[count]] = number[column[count]][row[count]]; return (number); } void matrix_M (int row[], int column[], int number[][6]) { for (row[count] = 1; row[count] <= 4; ++row[count]) { for (column[count] = 1; column[count] <= 5; ++column[count]) { printf ("%i\t", number[row[count]][column[count]]); } printf ("\n"); } } void matrix_N (int row[], int column[], int number[][6]) { for (row[count] = 1; row[count] <= 5; ++row[count]) { for (column[count] = 1; column[count] <= 4; ++column[count]) { transpose (row, column, number); printf ("%i\t", number[row[count]][column[count]]); } printf ("\n"); } } main () { /*Variable declaration*/ int number[5][6] = { {0,0,0,0,0,0}, {0,1,2,3,4,5}, {0,6,7,8,9,10}, {0,11,12,13,14,15}, {0,16,17,18,19,20} }; int row[count]; int column[count]; /*Execute functions*/ matrix_M (row, column, number); printf ("\n"); matrix_N (row, column, number); system("pause"); }

1 2 3 4 5

6 7 8 9 10

11 12 13 14 15

16 17 18 19 20

1 6 11 16

2 7 12 17

3 8 13 18

4 9 14 19

5 10 15 20

My problem is that some of matrix_N is displaying incorrectly. Here is how it looks:

1 6 11 16

6 7 12 17

11 12 13 18

16 17 18 19

5 10 15 20

What/where is the problem? Is it in the transpose function or the matrix_N function?

Thanks in advance for any help...