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 technician wants to update the organization's disaster recovery plans. Which of the following will allow network devices to be
Illusion [34]

Answer:B) Archives/backups

Explanation: Archive is the group of records of data that are saved for the future use.These are the historic data that is not currently used in the actual location .

Backup is the the the copy of the group of data that is not in the original form to be used in future. Thus the correct option is option(B).

Updating of the plans by the technician cannot be done through other given options because they don't hold the historic records of the data for the renewing of the plans.

6 0
3 years ago
Why does fiber optic communication technology have a significant security advantage over other transmission technology? higher d
erik [133]
Higher data rates can be transmitted Hope this helps!
7 0
3 years ago
Which of the following is the correct procedure for adding a design theme to a PowerPoint presentation ?
Eva8 [605]

Answer:

B. Design > Theme > choose a theme

Explanation:

-Applying themes-

  • Select the Design tab on the Ribbon, then locate the Themes group. Each image represents a theme.
  • Click the More drop-down arrow to see all available themes.
  • Select the desired theme.
  • The theme will be applied to the entire presentation. To apply a different theme, simply select it from the Design tab.
6 0
2 years ago
Which goal of design theory can be described as the proper distribution
muminat
The answer is balance
7 0
3 years ago
Which appears at the intersection of a column and row?
Evgesh-ka [11]
Between the intersection between every column and row is a cell.
6 0
2 years ago
Other questions:
  • (011001111)2=(?)10 can anyone solve this urgent <br><br> Hurry
    11·2 answers
  • Which options correctly describe Andrew's job role?
    6·1 answer
  • How do you determine latitude using an astrolabe?
    11·1 answer
  • In UNIX, how do I set the permissions on MyProgram.py to: rwx---r-x?
    7·1 answer
  • Do you know some website that can make a questionnaire? And I can use the link then put up on the social media so that everyone
    7·2 answers
  • Write code using the range function to add up the series 99, 98, 97,...
    11·1 answer
  • KAPWING Video Editing Software allows you to use existing You Tube Videos in your design.
    8·1 answer
  • Why is a computer called"a computer"?​
    12·2 answers
  • 100 POINTSSSSSSS!!
    5·1 answer
  • Describe some things that this person might say that might cause you to NOT hire them. Explain.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!