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
How much time does a gold chest take to open
MaRussiya [10]

Gold chest takes 8 hours to open or unlock.

<u>Explanation:</u>

Clash royale is a game which has been developed and published with the help of a super cell. It is a video game. Many players can play this game at the same time. In the sense, clash royale is a multi player game.

In this game, the players who are playing the game are awarded with the gold chest. They are also awarded with the gems. In order to unlock or open a gold chest eight hours are needed. Apart from this there is an other way also with which the gold chest can be unlocked. It can be unlocked with the help of forty eight gems.

7 0
3 years ago
5. The problem domain refers to the
solong [7]

Answer:

The problem domain refers to the support options.

6 0
3 years ago
A _____________ is designed for a individual user.
pishuonlain [190]

Answer:

i don't know it sorry

Explanation:

7 0
3 years ago
1. Describe how research and development influence design. Cite specific examples of how research and development influence desi
vladimir1956 [14]

Answer:

so i research and found this,

Development is when findings of a research are utilized for the production of specific products including materials, systems and methods. Design and development of prototypes and processes are also part of this area. Engineering is utilization of these plans and research to produce commercial products.

4 0
3 years ago
Please help, I can't find the answer but I understand the topic.
gladu [14]

Answer:

x=(2+3)*3;

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • How does this splitting wedge make work easier?
    15·1 answer
  • 4. How can you select non-adjacent cells (i.e. cells that are not all together in one block)?
    5·2 answers
  • What does snap do need the answer now
    10·2 answers
  • What tool can help discover and report computer errors and conflicts that occur when you first turn on a computer and before the
    15·1 answer
  • A small company is requesting a quote to refresh its wireless network. The company currently runs 60 autonomous APs and has plan
    13·1 answer
  • 3.24 LAB: Seasons
    13·1 answer
  • The bubble sort algorithm sorts using what technique?
    14·1 answer
  • Picking up sound over a great distance while making it seem to come from close up.
    11·1 answer
  • The term Linux Intrusion Detection System ( LIDS) refers to a command that allows an administrator to run processes as root with
    5·1 answer
  • Memory containing hardwired instructions that the computer uses when it boots up, before the system loads. In PCs the instructio
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!