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
MAVERICK [17]
3 years ago
15

Write a program to read in a two values row and col to initialize a 2D array using those values. Then create a function FindTran

spose to print both the original matrix and the transpose of the matrix.
Computers and Technology
1 answer:
anyanavicka [17]3 years ago
4 0

Answer:

The program to this question can be defined as follows:

Program:

#include <stdio.h> //defining header file

void FindTranspose(int r,int c,int ar[][c]);

int main() //defining main method

{

int r,c,i1,j1; //defining integer variable

printf("Enter row values: "); //message

scanf("%d",&r);//input row values

printf("Enter column values: "); //message  

scanf("%d",&c);//input column values

printf("input matrix number: "); //message

//defining loop to input value from user end

int ar[r][c]; //defining array

//input value in the loop

for(i1=0;i1<r;i1++)// row value

{

for(j1=0;j1<c;j1++)// column value

{

scanf("%d",&ar[i1][j1]); //input values

}

}

FindTranspose(r,c,ar); //calling function.

return 0;

}

//function FindTranspose to print original and transpose 2D array.

void FindTranspose(int r,int c,int ar[][c])

{

int i1,j1; //defining integer variable

printf("\nMatrix: \n"); //message

//print matrix

for(i1=0;i1<r;i1++)// row value

{

for(j1=0;j1<c;j1++)// column value

{

printf("%d ",ar[i1][j1]); // print value

}

printf("\n");

}

//print transpose matrix.

printf("\nTranspose of matrix\n"); //message

for(i1=0;i1<c;i1++)// column value

{

for(j1=0;j1<r;j1++)// row value

{

printf("%d ",ar[j1][i1]); //print value

}

printf("\n");

}

}

Output:

Enter row values: 2

Enter column values: 3

input matrix number: 1

2

43

5

6

7

Matrix:  

1 2 43  

5 6 7  

Transpose of matrix

1 5  

2 6  

43 7  

Explanation:

In the given code, the first header file is included, then declares a method, that is "FindTranspose". In this method, parameter two integer parameter and an array variable is passed.

  • Then the main method is declared, inside the main method, four integer variable "i1,j1,r,c, and ar" is declared, in which variable i1 and j1 used in loop and r,c is used to take input value of row and columns, and in the "ar" array we input value from the user, after input array element we call "FindTranspose" and pass a parameter, that is "ar,r, and c".
  • Inside the "FindTranspose" method, two integer variable "i1, and j1" is used in the loop, in the first loop it will print normal matrix, and in the second loop, it will print the inverse of this matrix.
You might be interested in
In a eukaryotic cell, DNA is found in
Nuetrik [128]
I think that DNA in a eukaryotic cell is found in a nucleus.

6 0
3 years ago
Read 2 more answers
A disciplined, creative, and effective approach to problem solving is needed for project success. The nine-step approach to prob
KatRina [158]

Answer: Determine the most popular solution.

Explanation:

Some of the approaches to problem solving that are listed here include:

• Gather data and verify the most likely causes.

• Revise the project plan.

• Evaluate the alternative solutions

To solve a problem, one needs to gather the data and verify the likely causes of the problem. This can be done by asking questions, running test, interviewing people, running tests, reading reports, or analyzing data.

The project plan can also be revised. Likewise, when one comes with different solutions, one should weigh the cost and benefits of each in order to choose the best solution.

Determine the most popular solution isn't a correct option.

6 0
3 years ago
What are the benefits of team collaboration?
guapka [62]

Pretty simple. Ever heard of the saying 'More minds are better than one'? Well, it's true. Not only would you come up with better answers with a shared opinion, your opinions and ideas are less biased from past experiences, so they are more accurate every time!. Plus, in terms of a team collab, tasks can be completed faster if everybody focuses on different things instead of one.

:)

4 0
3 years ago
Read 2 more answers
what is the name of the fields in an x.509 digital certificate that are used when the parties negotiate a secure connection?
Zigmanuir [339]

Answer:

Image result for what is the name of the fields in an x.509 digital certificate that are used when the parties negotiate a secure connection?

Common applications of X. 509 certificates include SSL/TLS and HTTPS for authenticated and encrypted web browsing, signed and encrypted email via the S/MIME protocol, code signing, document signing, client authentication, and government-issued electronic ID.

Explanation:

8 0
3 years ago
Have you ever been told sensitive or confidential information that made you uncomfortable? How did you deal with the situation?
Korvikt [17]
I would tell said individual to stop what they’re trying to tell me because if it’s not stuff I should know about or want to hear about then I don’t wanna hear any of it
7 0
3 years ago
Other questions:
  • The trademarked name of the accepted standard for configuring wireless networks is _______________
    12·1 answer
  • When talking about the physical elements of the internet, the term redundancy refers to:?
    13·1 answer
  • )a___ is a complete binary tree such that each node in the tree contains a comparable object that us greater than or equal to th
    9·1 answer
  • You can tell that the equals() method takes a ____ argument because parentheses are used in the method call.
    6·1 answer
  • Explain how software is distinct from hardware.
    8·2 answers
  • Did anyone else remember that Unus Annus is gone? I started crying when I remembered.... Momento Mori my friends.... Momento Mor
    9·2 answers
  • Which of the following is NOT a file format used for word processing documents? A. .ppt B. .rtf C. .doc D. .odt
    5·1 answer
  • Write a logical expression using only and, or and not that is equivalent to the Exclusive NOR (XNOR) gate on 2 inputs, called in
    15·1 answer
  • The action of entering data into your computer. This can be text typed in a word processing document, keywords entered in a sear
    8·1 answer
  • Which option will be used to attach email messages ​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!