Question: Output of all programs must be included with your code. 1. Write a C - program that fills the left-to-right diagonal of a square matrix
Output of all programs must be included with your code.
1. Write a C - program that fills the left-to-right diagonal of a square matrix (a two-dimensional array with an equal number of rows and columns - 6 ) with zeros, the lower left triangle with
-1s, and the upper right triangle with +1s.
|
0 |
1 |
1 |
1 |
1 |
1 |
|
-1 |
0 |
1 |
1 |
1 |
1 |
|
-1 |
-1 | 0 | 1 | 1 | 1 |
|
-1 |
-1 |
-1 |
0 | 1 | 1 |
| -1 | -1 | -1 |
-1 | 0 | 1 |
|
-1 |
-1 |
-1 |
-1 |
-1 | 0 |
2. Using two separate user defined functions, write a C program with arrays to find the sum of each row and each column of the following matrix. Print out the original array and the results with appropriate statements.
10 21 30 39 50
15 33 41 10 42
16 18 64 20 12
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
