think about it...
since the indices of the first and second dimensions are always the same, you're adding up the elements of the diagonal of the matrix.
x[0][0]+x[1][1]+x[2][2]...
i'm just afraid that's all the help i'm going to give you. this problem is pretty trivial and you need to "get" this concept. try writing out the values differently so that the array more closely resembles a square matrix like so:
Code:
int x [4] [4] =
{
{1 , 2 , 3 , 4} ,
{5 , 6 , 7 , 8} ,
{9 , 8 , 7 , 3} ,
{2 , 1 , 7 , 1}
};
solving your problem should be very easy now .
good luck.