You may try the following :
--------------------------------------------------------------------
#define MATRIX_SIZE 10
int main(int argc, char *argv[])
{
int matrix[MATRIX_SIZE][MATRIX_SIZE];
int i;
.....
.....
for(i = 0 ; i < MATRIX_SIZE ; i++)
{
printf("%d\n", matrix[i][i]);
}
}
--------------------------------------------------------------------
The code above prints all the diagonal elemets in a square matrix to
the screen.
Of course, you have to make sure that the matrix elements are valid
before you attempt to read the elements you want.