☑Kizspy.me
4 of 4
Paper No: 7
Your program allows user to enter a square matrix of size n x n (with n>1).
The program prints the matrix and the sum of the elements on the main diagonal (from the top-left to
the bottom-right).
Below is an example of how the program will run.
For example, enter 3 for 'n" and elements of matrix: 123456789
Question 6:
Zoom
- FUO
+ 100%
3
1 2 3 4 5 6789
OUTPUT:
1 2 3
456
789
15
Press any key to continue ...
Close