1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
natta225 [31]
3 years ago
13

Write a program (using functions) starting from directives to compute and display the transpose of a matrix of dimension m x n.

[Note: Here, transpose of a matrix means the element at row r and column c in the original is placed at row c and column r of the transpose]. (Programming in C)
Computers and Technology
1 answer:
pentagon [3]3 years ago
3 0

Answer:

#include <iostream>

#include <cstdlib>

using namespace std;

int m, n;

void transpose(int matrix[]){

  int transp[m][n];

  for (int i = 0; i < n; i++){

     for (int j = 0; j < m; j++){

        transp[j][i] = matrix[i][j];

        cout<< transp[j][i]<< " ";

     }

     cout<< "\n";

  }

}

int main(){

  cout<< "Enter the value for n: ";

  cin>> n;

  cout>> "Enter the value for m: ";

  cin>> m;

  int mymatrix[n][m];

  for (int i = 0; i < n; i++){

     for (int j = 0; j < m; j++){

        mymatrix[i][j] = (rand() % 50);

     }

  }

  transpose(mymatrix);

}

Explanation:

The C source code defined a void transpose function that accepts a matrix or a two-dimensional array and prints the transpose on the screen. The program gets user input for the row (n) and column (m) length of the arrays. The C standard library function rand() is used to assign random numbers to the array items.

You might be interested in
A <br> is usually written in block style with the body text aligned along the left margin.
Fiesta28 [93]

Answer:

can you give the question and the rest of the answers? (if possible)

Explanation:

i dont really get it, are you answering a question or something?

7 0
3 years ago
Read 2 more answers
What needs to be done before depositing a check using a mobile app?
galben [10]

Answer:

The check needs to be signed in the back by you or whoever is depositing it.

7 0
2 years ago
Read 2 more answers
The winning design is typically that which most closely meets the design
zimovet [89]

when the when the when the add the when are you is id god his gay for your top off jack dafe cafe read line green red whats the answerAnswer:

when the when the when the add the when are you is id god his gay for your top off jack dafe cafe read line green red whats the answer

Explanation:

7 0
3 years ago
Assume that the variables gpa, deansList and studentName, have been declared and initialized . Write a statement that both adds
Alborosie

Answer:

Following are the statement which is given below:

if (gpa > 3.5)  // check the condition if gpa exceeds 3.5.

{

deansList++;  // increment of 1 in the deansList variable

cout << studentName;  // display the studentName,  

}

Explanation:

The description of the statement

  • In the if statement we check the condition of "gpa" .if  "gpa"  is greater then 3.5 then it executed the statement inside the if block otherwise nothing will be executed.
  • if control moves to the if part it adds to 1 to the deansList.
  • Finally, display the value of studentName.
3 0
3 years ago
I need some help with ideas
Troyanec [42]

Answer:

Maybe make a loud noise when there is an unacceptable speed

Explanation:

If you speed above the limit you will get a ticket to if it makes a loud noise you can be annoying and speed at the acceptable speed

5 0
3 years ago
Other questions:
  • Rebecca completed work on a computer and is verifying the functionality of the system when she finds a new problem. This problem
    13·1 answer
  • When looking at a poster from the Art Deco movement, what one design characteristic would you most expect to see?
    6·1 answer
  • What type of hardware enable user to interact with a computer
    15·1 answer
  • NOTE: in mathematics, the square root of a negative number is not real; in C therefore, passing such a value to the square root
    15·1 answer
  • The fraction 460/7 is closest to which of the following whole numbers?
    11·1 answer
  • Which statement describes part of the meeting scheduling process? It is always an all-day event. It is created in a single calen
    14·1 answer
  • Hey plz help, and thanks
    12·2 answers
  • Who wrote the book of luke​
    7·1 answer
  • Convert Octal 623, to Decimal number ​
    10·1 answer
  • Select the correct answer.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!