Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program which fills a matrix of size NxM with random integers between 0 and 100 and sorts the matrix in descending order.

Write a C program which fills a matrix of size NxM with random integers between 0 and 100 and sorts the matrix in descending order. N and M are the numbers of rows and columns entered by the user. The maximum number of rows and columns can be 100.

Your program should implement the following functions:

a. void fillMatrix(int A[][],int N, int M): To generates NxM random numbers between 1 and 100 and stores them in array A.

b. int sortMatrix(int A[][],int rowsize, int colsize): To sort the input array c. void displayMatrix(int A[][],int N, int M): To display the array elements (N rows and M columimage text in transcribedns).?

(N rows and M columns). Sample Interaction: Enter number of rows: 100 Invalid size! Enter number of rows: Enter number of c lumns: 3 Before Sorting: 3 1 8 2 4 56 3 7 9 After sorting: 9 8 7 6 5 4 3 2 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Explain the solution.

Answered: 1 week ago

Question

5. Do you have any foreign language proficiency?

Answered: 1 week ago