Question: A numerical matrix is called 'diagonal' If all the elements outside of the top - left to bottom - right diagonal are equal to zero.

A numerical matrix is called 'diagonal' If all the elements outside of the top-left to bottom-right diagonal are equal to zero. For example:
Is a diagonal matrix, while.
Is not diagonal.
Given a square 2-dimensional int array called matrix, where both row and column numbers are equal to the value stored in the int variable n. Assign to the bool variable isDiagonal (already declared but not initialized) true if the matrix is diagonal, false otherwise.
Each elementis. Write a test program that prompts the user to enter two 3-by-3 matrices and displays their addition.
Sample Run
Enter matrix1: 123456789
Enter matrix2: 02314.52.21.14.35.2
The addition of the matrices is
123024147
456+14.52.2=59.58.2
7891.14.35.28.112.314.2

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 Programming Questions!