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
You have been on the phone with a user in a remote office for 30 minutes troubleshooting their minor desktop problem. No matter
Alecsey [184]

Answer:

D

Explanation:

First when you are troubleshooting a client your main goal is to solve their issue, you dont want to say hey call later i cant help you or say call someone else because picture this you need help and someone hangs up on you or says (B.) or (C.) it comes off as rude i would say. Regarding (A.) im not 100% sure what exactly do you mean by user's site? But asking for their manager (D.) or someone else (preferably higher up) seems to be the right action to be taken.

4 0
3 years ago
Now write a program named GreenvilleRevenue that prompts a user for the number of contestants entered in last year’s competition
ss7ja [257]

Answer:

The c# program is given below.

using System;

class GreenvilleRevenue  

{

   static void Main() {

       // variable declared and initialized simultaneously

       int fees = 25;

       int last, present, rev;

       Console.WriteLine( "Enter the number of contestants participating in last year’s competition " );

       last = Convert.ToInt32(Console.ReadLine());

       Console.WriteLine( "Enter the number of contestants participating in this year’s competition " );

       present = Convert.ToInt32(Console.ReadLine());

       Console.WriteLine( "Number of Participants in last year's competition  \t\t" + last);

       Console.WriteLine( "Number of Participants in present year's competition   \t" + present);

       rev = present*fees;

       Console.WriteLine( "Revenue expected in this year’s competition is \t\t\t$" + rev );

       if(last < present)

           Console.WriteLine( "Participants are more this year" );

       else if(last > present)

           Console.WriteLine( "Participants are less this year" );

       else if(last == present)

           Console.WriteLine( "Participants are same both years" );

   }

}  

OUTPUT

Enter the number of contestants participating in last year’s competition  

111

Enter the number of contestants participating in this year’s competition  

123

Number of Participants in last year's competition    111

Number of Participants in present year's competition    123

Revenue expected in this year’s competition is   $3075

Participants are more this year

Explanation:

This program takes input from the user. The input is not validated as this is not mentioned in the question.

1. An integer variable is declared and initialized by the fees of this year’s competition.

2. Integer variables are declared to store participants for last year, present year and revenue earned in the present year.

3. User enters the number of participants in last year’s competition.

4. User enters the number of participants in this year’s competition.

5. All the input from the user is displayed.

6. The revenue earned in this year’s competition is computed and displayed.

7. The message is also displayed whether number of participants this year is greater or not than the last year.

8. Also, if participants are same in both years, the message is displayed accordingly.

6 0
4 years ago
Which column and row references are updated when you copy the formula f$3/15
Tasya [4]

Answer: Column F

Explanation: In Microsoft excel, for the sake of robustness and to aid the effectiveness of updating formulas across cells. The reference of cells are treated as relative which means that when formulas are copied across columns or within rows, they get updated automatically. However, some numbers may be treated as constants such that we do not want them to change or be updated as we move acisss cells. Thus, such numbers are treated Given absolute references, which is made possible by adding a '$' prefix before the colum alphabet or row number or both. in the scenario given above, the row has the $ prefix, hence, it is absolute and will not change but the column alphabet does not and hence, treated as relative.

3 0
3 years ago
Content controls cannot be removed, only edited. Please select the best answer from the choices provided
Anton [14]
 False is your answer
5 0
3 years ago
Declare a char array named line suitable for storing C-strings as large as 50 characters, and write a statement that reads in th
zlopas [31]

Answer:

char line[50];

cin.get(line,50);

Explanation:

The "char" data type stores character data in a fixed-length field.

3 0
3 years ago
Other questions:
  • A half-life is the amount of time it takes for a substance or entity to fall to half its original value. Caffeine has a half-lif
    11·1 answer
  • A _____ attack keeps the target so busy responding to a stream of automated requests that legitimate users cannot get in
    9·1 answer
  • What are the advantages of technology ​
    14·1 answer
  • You are consulting for a trucking company that does a large amount ofbusiness shipping packages between New York and Boston. The
    5·1 answer
  • What is the awnser ?
    11·1 answer
  • Write a program that declares an array named myArray with 8 components of the type int. Initialize the array to 8 values that th
    6·1 answer
  • Choose the accurate answer from the drop-down choices.
    11·1 answer
  • Directions and Analysis
    15·1 answer
  • The most common types of utility programs fall into these categories.
    7·1 answer
  • Q) Look at the code sequence and select the correct output
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!