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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started