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
DO MOBILE DEVICES HAVE TO WORK IN LIMITED SCREEN SPACE
Taya2010 [7]
Yes, mobile devices have to work in limited screen space.
8 0
3 years ago
Read 2 more answers
What makes software engineering an engineering discipline and what makes software engineering different from other engineering d
sweet [91]
26 + 26 = 57 but when it takes away 2 it = 55 if you really wanna think about it that much
8 0
2 years ago
As you are talking to your colleague over the phone, the sound of an airplane flying low drowns out part of your conversation. I
Rasek [7]

Answer:

Interference.

Explanation:

As the user is communicating with their friend through the mobile, most of their interaction is interrupted by the noise of an airplane flying at low hight. Instantly afterward, the user's mobile phone rang, disrupting the communication once more.  

So, according to the following scenario both of those are examples of interference.

6 0
3 years ago
In word, the ____ presents the most accurate view of how your document will look when printed, displaying the entire page on scr
makkiz [27]
<span>When using Microsoft Word, the "Print Preview" presents the most accurate view of how the document will look when it is printed. When using "Print Preview" the entire page is displayed on screen, making it easier to see what adjustments should be made to the page layout, such as spacing or text size.</span>
7 0
3 years ago
All the employees of Delta Corporation are unable to access the files stored in the server. What do you think is the reason behi
CaHeK987 [17]
C serve crash hope this is correct
5 0
3 years ago
Other questions:
  • The eastern front was longer than other fronts of the war true or false
    7·2 answers
  • A.<br> Post-It note<br> b.<br> notebook<br> c.<br> tutor<br> d.<br> spell check
    14·1 answer
  • Which of the following is a school-to-work program that provides the student with paid employment, school credit, and school gra
    7·2 answers
  • 17) you need to locate an article that (1) is published by a university or proffessional association(2) is authored by clearly d
    6·1 answer
  • Data as a service began with the notion that data quality could happen in a centralized place, cleansing and enriching data and
    15·1 answer
  • Exercise#3: Write a program that performs the following: Declare a two arrays called arrayA and arrayB that holds integer and th
    14·2 answers
  • 1) SuperFetch is a memory-management technique that a) determines the type of RAM your system requires. b) makes the boot-up tim
    7·1 answer
  • What are different social phenomenas are you aware of that used part of a social movement, change, or cause
    14·1 answer
  • . Why is it important to use Social Media responsibly? ANSWER NOW!!!
    15·2 answers
  • Should a UDP packet header contain both Sour Port # and Destination Port #?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!