Hello everyone
Can anyone help me with codes to calculate sum of numbers in the diagonal of a 2 dimensional matrix array. Please help. (a b c d e
f g h i j
j k l m n
o p q r s)
FELIGO
0
Newbie Poster
Recommended Answers
Jump to PostHi FELIGO, welcome :)
Sure we can help!
What have you tried for yourself?If you post code, post it in CODE tags!!!
Jump to PostIs maybe this what you have been looking for:
int[,] array = new int[2, 4] { { 1, 2, 3, 4 }, { 1, 2, 3, 4 } }; List<int> list = new List<int>(); for (int i = 0; i < array.GetLength(1); i++) { int sum = …
All 5 Replies
ddanbe
2,724
Professional Procrastinator
Featured Poster
Mitja Bonca
557
Nearly a Posting Maven
sandeepparekh9
109
Posting Whiz
zmeditation1
0
Newbie Poster
Mitja Bonca
557
Nearly a Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.