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
An ecommerce ____________ is the software that handles ecommerce transactions.​
Shkiper50 [21]
<span>An ecommerce application is the software that handles ecommerce transactions.​  It helps customers to find products, make a selection and submit payment.  A key component of an ecommerce application is an online shopping cart. </span>
7 0
2 years ago
The line of code after a line beginning with the word 'else' needs to begin with a(n) ___.
Julli [10]
The answer to your question is D
7 0
1 year ago
Match the IT role to the best description:
Bad White [126]

1. Use many of the same skills and technologies as Web application developers to create applications for devices such as smartphones and tablets - Mobile Application Developers

2. Websites designed specifically for mobile device browsers - Web Architects

3. Applications created specifically for mobile operating systems, such as Google Android or Apple iOS - Mobile Apps

4. They consult with the management team and Website users to design and implement the plan for developing and maintaining the organization's Website - Interface Designer  

5. use Web programming languages or products to develop Websites, generally for Web server applications - Web Application Developers  

<u>Explanation:</u>

The definitions and its terms are self explanatory. A <em>mobile application developer</em> will develop applications for mobiles and other gadgets.

<em>Mobile Websites</em> can be accessed only from browsers of mobile.

<em>Android or iOS</em> are the operating system designed for Mobile.

Interface designers develop designs for websites.

<em>Web app developers</em> develop websites using web programming languages.

7 0
3 years ago
The animal shelter requires that people who volunteer there affirm that they are not allergic to dogs or cats. How would you mod
shepuryov [24]

Answer: Through the use of close-ended questions, for example a question with a YES/NO answer.

Explanation:

Close ended questions are questions in which a participant has already been provided with options to a question, and so the participants must choose from the options and cannot give an answer outside the options given.

Using this kind of question to modify the database schema would be helpful.

Therefore, in order to affirm that the volunteers are not allergic to dogs or cats, the close ended question "are you allergic to dogs or cats" can be used. The volunteers would be provided with a yes or no answer which they must choose from.

This would help in modifying the database schema while affirming whether the volunteers are allergic to dogs or cats.

5 0
3 years ago
Read 2 more answers
JKJKNJJNJJJLKN;K;L;LHNL;BJ
bezimeni [28]

did you have a stroke bestie?

8 0
3 years ago
Read 2 more answers
Other questions:
  • The Huntington Boys and Girls Club is conducting a fundraiser by selling chili dinners to go. The price is $7 for an adult meal
    8·1 answer
  • How can you put a logo on html without breaching the copyright, design and patents act
    12·1 answer
  • Given the following MIPS Code Fragment:
    14·1 answer
  • ALGUEM SABE COMO MUDA O NOME DE PERFIL!?!?!? SE SOUBER ME AJUDA!!
    14·1 answer
  • Private sharing model on Opportunities. Leadership has asked the Administrator to create a new custom object that will track cus
    7·1 answer
  • Write a program that ask the user to enter air water or Steele and the distance that a sound wave will travel in the medium the
    9·1 answer
  • Can anyone help???
    6·2 answers
  • Using an outline, how do you maintain your computer or cellphone​
    8·1 answer
  • Explain how communication managerial efficiency​
    13·1 answer
  • Explain why you do not need expensive equipment to take pictures or record video?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!