Question: Given a 2D array a, compute the sum of the forward diagonal (shaded) as well as sum of the backward diagonal (bold font). Using only

 Given a 2D array a, compute the sum of the forward

Given a 2D array a, compute the sum of the forward diagonal (shaded) as well as sum of the backward diagonal (bold font). Using only one loop, Complete the code to compute both sums. For example, if a is 4 times 4 matrix: then The forward diagonal sum is: 18 The backward diagonal sum is: 21 include namespace std; int SIZE = 100; in()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!