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
Which job role requires you to create user guides for computer products and services?
kipiarov [429]

For plato I think technical writer is the answer.

Technical writer: As a technical writer, you’ll create user manuals and support guides for a number of computer products and services. You may also develop content to market technical products online.

4 0
3 years ago
Read 2 more answers
Steps of booting a computer
Lostsunrise [7]
Steps of Booting
The Startup. It is the first step that involves switching the power ON. ...
BIOS: Power On Self Test. It is an initial test performed by the BIOS. ...
Loading of OS. In this step, the operating system is loaded into the main memory. ...
System Configuration. ...
Loading System Utilities. ...
User Authentication.
8 0
2 years ago
Choose the correct answer base on the Components of Computer System
kondor19780726 [428]
1 - b - Excel is a computer program, so it'd be Software
2 - a - Process of elimination, haven't heard of the term 'peopleware' before.
3 - d - A joystick accepts input from a user to interact with a computer. ex. Flight Simulators
4 - c - A monitor will display (or output) an image based on what is received from the computer.
4 0
3 years ago
In a penetration test, the ________ team comprises testers who are given no knowledge of the infrastructure and are attacking a
just olya [345]

Answer:

TIGER TEAM

Explanation:

Penetration testing is the act of simulating an attack on an organization's resources to assess an infrastructure's true vulnerabilities. A penetration test simulates an actual attack. Penetration testers use a variety of methods including social engineering, software hacking and physical intrusion.

There are different types of penetration testing teams which are: red team, blue team and purple team.

Red team also known as the tiger team simulates real types of cyber attacks in order to discover any unknown security vulnerabilities or weaknesses.

In penetration testing, tiger (red) team are the attackers and are usually outside contractors, with a lot of knowledge of how to break in but NO KNOWLEDGE OF WHAT SECURITY IS IN PLACE.

Therefore, In a penetration test, the TIGER TEAM comprises testers who are given no knowledge of the infrastructure and are attacking a target that is unaware of their existence until the attack is made.

3 0
3 years ago
The calculation of GDP is the sum of: Consumption, Investment, Government Spending, and Net Exports. What is the simple formula
12345 [234]
The correct answer is B
3 0
3 years ago
Other questions:
  • You can double-click a window’s title bar to maximize the window. true false
    9·1 answer
  • Hw to gain more knowledge ​
    6·1 answer
  • Not providing guarding or fall protection for workers on a 25-foot scaffold. The resulting fall would most likely end in death,
    6·1 answer
  • How many bits are used to direct traffic to specific services running on a networked computer?
    6·1 answer
  • How does a linear algorithm perform compared to a quadratic one on our imaginary race track?
    5·1 answer
  • Words that have a special meaning in a programming language are called
    13·1 answer
  • ____ is the most widely used language for writing system software because it combines the power of a high-level language with th
    12·1 answer
  • When Creating a FPS game what basic rules would you add?
    12·1 answer
  • In dos operating system ,write a command to delete the directory as well as the files of the directory ''world'' on drive E.
    15·1 answer
  • Which of the following is not a key component of a structure?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!