How to implement the following program:
- Keyboard input some n
- Choice k (number n): k from 1 to n (any, also keyboard input)
- Create n number of diagonal matrices (n × n), where k will be on the main diagonal.
Example:
- n = 3
- k1 = 2, k2 = 4, k3 = 7
Matrices:
(1 matrix)
200 020 002(2 matrix)
400 040 004(3 matrix)
700 070 007