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
What is Function of print statement?
trasher [3.6K]

Answer:

To print the statement in the output.

Explanation:

Im a student of C4 and I know this one its In C programming.

6 0
3 years ago
Read 2 more answers
1 paint 2 anahaw leaf 3 shellac 4 varnish 5 metal sheets 6 paint 7 G.I. pipe 8 enamel paint 9 bamboo 10 fillers
Aleksandr-060686 [28]

?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

8 0
2 years ago
Unless you explicitly initialize global variables, they are automatically initialized to
shusha [124]

Answer:

Zero(0)

Explanation:

<u>Global Variables </u>

Variables which are declared outside any function. Any function can use these variables,they are automatically initialized to zero(0).They are generally declared before main() function.

Example- C program for showing global variable is 0.

  #include <stdio.h>

   int g;  // declaring g as global variable

   int main()

   {

       printf("%d",g);  //printing global variable

       return 0;

    }

<u>Output</u>

  0

4 0
3 years ago
an error message is displayed during windws startup about a service that has failed to start, and then the system locks up. You
Tanzania [10]

Answer:

1:-Launch Windows RE and perform a Start Repair.

2:- Until you pick the Last Documented Successful Configuration on the Advanced Boot Options menu are the correct answer of this question.

Explanation:

Technology company Rescue is a Software restore tool capable of fixing some device issues that can prevent Microsoft for operating. Install Repair checks your Computer for the problem and then attempts to fix it, so that your Computer can start properly.

The Enhanced Boot Preferences app lets you connect to the internet in advanced mode for troubleshooting.

4 0
3 years ago
Question 3<br> Which industrial revolution can the invention of the flashlight be associated with?
Ket [755]

Answer:

The invention of flashlight is associated in the late period of industrial revolution.

Explanation:

  • During the industrial revolution, Europe and United States flipped the use or technology in the manufacturing processes of industries.
  • At the time of industrial revolution many chief inventions like, steam engine, dynamites etc. were made that the traditional history and reformed the technology.
  • Thomas Edison in 1879, invented the battery and flashlight at the late period of industrial revolution which was also a major invention
7 0
3 years ago
Other questions:
  • Describe in one or more complete sentences how someone starting a computer repair business in a town night gain a competitive ad
    15·1 answer
  • SQL a. has become the de facto standard database language b. can be used to define database systems c. both a. and b. d. none of
    10·1 answer
  • man who is colorblind marries a woman who has normal color vision and is not a carrier of color blindness. If this couple has a
    15·1 answer
  • What is the best data structure to solve the following problem? a) A list needs to be built dynamically. b) Data must be easy to
    11·1 answer
  • Of the various trends affecting the advertising and promotion industry, _____________ offers an opportunity for advertisers to d
    9·1 answer
  • How are special characters added to a Word document? Check all that apply.
    6·2 answers
  • L00000000000000000000000000000000000000000000000000000000l they b00ty tickled
    6·2 answers
  • What are the paparazzi?
    8·1 answer
  • _____ provide a label or explanation of an image or object.
    5·1 answer
  • python. create a program that asks the user to input their first name and their favorite number. Then the program should output
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!