Question: Written in C++, used in code blocks. I am stuck on writing the code for the sum of diagonal elements. This is what i have

Written in C++, used in code blocks. I am stuck on writing the code for the sum of diagonal elements. This is what i have so far.

#include

#define SIZE 4

int main() { int A[SIZE][SIZE]; int row, col, sum = 0; int d_sum = 0;

// Wasn't sure how to display the matrix, but I got it so you type in the table exactly how you see it and it will output everything correctly. //This function below prints your table printf("Enter elements in matrix of size %dx%d: ", SIZE, SIZE); for(row=0; row

printf("Sum of elements of Row %d = %d ", row+1, sum); } // This function prints all the column sums for(row=0; row

printf("Sum of elements of Column %d = %d ", row+1, sum); } // This function prints the diagonal sum. for(row=0; row

return 0; }

Written in C++, used in code blocks. I am stuck on writing

-With given values of "a", "b, c", "d, e", and "f", the answer for x is Answer', and y is "Answer" 3. For the given table below, 1) use array to calculate row sum, column sum and sum of diagonal elements. 2) And create a new Table Array with the result then display it! 4 8 12 16 6 10 9 13 15 New Table Array 4 8 12 16 Column 4 Sum Row 1 Sum Row 1 Sum Row 1 Sum Row 1 Sum Diagonal 6 10 9 13 Column 1 Sum Column 2 Sum 15 Column 3 S um Sum

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!