sum of diagonals in 4*4 array

how can i find he sum of row and diagonals of 4*4 array
1
2
3
4
5
6
int array[3][3];
int sum;
for ( int count = 0 ; count < 4 ; count++ ) {
sum += array[count][count] + array[count][3-count] + // next line
array[count][0] + array[count][1] + array[count][2] + array[count][3];
}

do you mean this?

if it wont work, dont blame me
im new
doraid:
What have you tried so far?
You need knowledge of: arrays, for loops and stuff.

dark knight:
arrays should be declared 4 by 4 (the max index to access n on both indices is 3)
I think he wants the sum of each row and each diagonal apart.
I'm not sure how he wants it stored btw.
thanks for reply i will try
Topic archived. No new replies allowed.