Question: DO NOT USE GLOBAL VARIABLES WHEN SOLVING THIS ASSIGNMENT 1. Write a function to read and store integer elements into an nxn matrix, where n

 DO NOT USE GLOBAL VARIABLES WHEN SOLVING THIS ASSIGNMENT 1. Write
a function to read and store integer elements into an nxn matrix,

DO NOT USE GLOBAL VARIABLES WHEN SOLVING THIS ASSIGNMENT 1. Write a function to read and store integer elements into an nxn matrix, where n is input from the user. The maximum number of rows and columns is 10. Write a recursive function that receives as parameters a matrix and the size of the matrix. The function should compute and return the sum of the numbers located on the left diagonal of the matrix. You may find the sum of the numbers on the left diagonal of the matrix. Write a main program that reads the size of the ma read the square matrix and print the sum of the values on the left diagonal of the matrix. For example, if the matrix entered is: not use loops within the functions. You may write only one function to trix from the user then makes use of the functions written above to left diagonal 5 6 79 9 0 then the sum returned should be: 1+61 6 14 2. Determine if any element in a 2D array is duplicated: a) Write a function that takes a two dimensional array, number of rows and number of columns as arguments. The function should read the elements of the matrix from the user and store them in the two dimensional array Write a function that returns I when a duplicate element is detected in a 2D array of integers. Otherwise the function returns 0. The function returns immediately when it detects the first duplicate; it does not need to look for additional duplicate elements b) A prototype for the function is: int iaDuplicate int xIJ(NUMCOLS1, int nrows, int ncola): c) Write a main program that makes use of the functions above to: Read a matrix from the user, where the number of rows and number of columns should be input from the user. The maximum dimensions of the matrix are 10x10. Print a message stating whether the matrix contains duplicate elements or not

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!