I want to know the conditions for the 4 main areas of a matrix besides the diagonals.
For example in the following matrix
A=[1,2,3,4,5;
6,7,8,9,10;
11,12,13,14,15;
16,17,18,19,20;
21,22,23,24,25;]
The elements from the north side would be 2,3,4,8; from the west side would be 6,11,16,12; from the east side 10,15,20,14; and from the south side 22,23,24,18;
All I figured out is that the north part can be written as:
for(i=0;i<n;i++)
for(j=i+1;j<n-i-1;j++)
printf("%d",v[i][j])
For the other areas, I'm stuck. Can anyone help me?