Question: Need this to be done in C programming !!! Use the code skeleton on the next page to write a C program that allows the

Need this to be done in C programming !!!

Use the code skeleton on the next page to write a C program that allows the user to create any square matrix (a 2D arrays with the same number of rows and columns), for instance, a square matrix of size 5 is a 2d array of 5 rows and 5 columns. Your main program should:

  1. Allow the user to set the size (order) of the square matrix

  2. Set the values of the matrix

  3. Print the square matrix on the screen in a tabular format

  4. Check and print if the square matrix is a magic square or not.

  5. Check and print if the square matrix is a distinct matrix or not.

  6. Sort the square matrix using row-wise approach.

  7. Calculate the transpose matrix for the square matrix

Can you please provide complete main code as well

The following is the code skeleton :

#include  #define MAX 100 void setMatrixData(int numOfRows, int mat[][numOfRows]){ // provide the implementation } void printMatrixData(int numOfRows, int mat[][numOfRows]){ // provide the implementation } int isMagicSquare(int numOfRows, int mat[][numOfRows]){ // provide the implementation return 1; // if the matrix is a magic square } int isDistinctSquare(int numOfRows, int mat[][numOfRows]){ // provide the implementation return 1; // if the matrix has no duplicates all values are unique } void SortRowWise(int numOfRows, int mat[][numOfRows]){ // provide the implementation } void GetTranspose(int numOfRows, int mat[][numOfRows], int tran[][numOfRows]){ // provide the implementation } int main() { int matrix[MAX][MAX]; int transpose[MAX][MAX]; int numOfRows; printf("Done..."); }

A row-wise sorting for a matrix is to short each row in the input matrix in ascending order, for example, given the following:

Need this to be done in C programming !!! Use the code

The output will be the following a row-wise sorted matrix

skeleton on the next page to write a C program that allows

Given a square matrix, the transpose of the matrix is a new matrix whose rows are the columns of the original. (This makes the columns of the new matrix the rows of the original). Here is a matrix and its transpose:

the user to create any square matrix (a 2D arrays with the

-1 -4 9-9-8-7 1 1 1 71 8 5 9-6 1 1 Original Matrix Transpose Matrix

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!