5 X 5 Two dimensional integer array in the main function and its diagonal sum.should i use 3 pre-defined functions?
example like this :
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
sum is = 117
It seems that a pre-defined structure would be useful, but this is simple enough that you could take any square matrix.
The sum is easy enough to compute with a couple of loops, making sure not to add the center value in an odd matrix more than once.
Hope this helps.
How is that amusing? Someone asks for help and you post code you knew would be cryptic to a beginner. Get over yourself douche bag.
1) This is the General C++ Forum
2) Why don't you watch your mouth?
~psault