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
13./ Write a java program to input an integer N and compute its factorial. Print the number and the factorial.
antoniya [11.8K]

Answer:

Código Java de forma recursiva que nos ayuda a calcular el factorial de ... El factorial de un número es la multiplicación de los número que van del ... Para expresar el factorial se suele utilizar la notación n! ... mayo 5, 2010 - 4:13 am ... un programa q de un numero dado en arabigo o romano lo imprima ya

Explanation:

Espero te sirva!!

3 0
2 years ago
How to solve level 53 on rapid router?
alexgriva [62]

&lt;img src=/static/game/image/actions/go.svg alt=' + ugettext(play= button)= += '= style=width: 4%;&gt; ) def noPermissionMessage():

6 0
1 year ago
Choose the output result of the below code.
SIZIF [17.4K]

Answer:

B

Explanation:

When you initialize an instance of FunEvent(tags, year) and assign it to bc. The instance variables in this case are: self.tags = ["g", "ml"] and self.year = 2022. But then you alter tags, which will also change self.tags, since self.tags is a reference to the list you passed in as an argument. This is not the case when you do year=2023 because, first of all, integers are not mutable, and also because even if somehow integers were mutable, you're not changing the object in-place, you're simply changing the where the "variable" is pointing to. So for example if you did tags = ["g", "ml", "bc"] instead of tags.append("bc"), it would also not change the value of the instance variable "tags", because you wouldn't be changing the object in-place. So when you print(bc), the instance variables will be ["g", "ml", "bc"] and 2022. When you try to print an object, it call try to convert it into a string using the __str__  magic method. In this case it will return a string formatted as "Event(tags={self.tags}, year={self.year}) which will output "Event(tags=['g', 'ml', 'bc'], year=2022)" So the correct answer is B

4 0
2 years ago
HELP ASAP DONT ANSWER WITH A LINK​
OlgaM077 [116]

Answer:

<u>Layout</u>

title

title and content

section header

comparison

<u>Orientatio</u><u>n</u>

landscape

portrait

8 0
2 years ago
Can someone please answer this for me ? What is data centre virtualization?
castortr0y [4]
Data center virtualization is the process of designing, developing and deploying a data center on virtualization and cloud computing technologies. It primarily enables virtualizing physical servers in a data center facility along with storage, networking and other infrastructure devices and equipment.
3 0
2 years ago
Other questions:
  • If you are a driver under 21 with a breath or blood alcohol level of ____ or higher, you will be required to attend a substance
    11·2 answers
  • I would A lot of knowledge and education for computers and <br> Technology
    10·2 answers
  • How many arguments are required for the sum function?
    15·1 answer
  • Many people keep time using a 24 hour clock (11 is 11am and 23 is 11pm, 0 is midnight). If it is currently 13 and you set your a
    10·1 answer
  • Write an algorithm of telephone call system​
    10·2 answers
  • Ron is creating building blocks in Word. How can he make the building blocks that he created available?
    10·2 answers
  • Which of the following are drivers of machine learning growth?
    15·1 answer
  • A(n) _____ is a computerized system by which subscribers are able to communicate to all other subscribers by sending a transmiss
    5·1 answer
  • What is the name for data generated by a computer using an algorithm?
    7·1 answer
  • Which button on a desktop computer begins a reboot of the computer without power being removed from the computer's components?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!