Question: Programs must include a Programmers Block and an explainProg function. Output of all programs must be included with the code Write a C - program

Programs must include a Programmers Block and an explainProg function.

Output of all programs must be included with the code

Write a C - program with a user-defined function 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 +ls. Your program should produce the following result with an appropriate statement.

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. Add three separate user - defined functions (using arrays) to your program of question 1, 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. The array must be initialized in 1 function and then passed to the sum of rows function and then to the sum of columns function.

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

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