How to transpose rows into columns and columns into rows in
a multi-dimensional array?

Answer Posted / venugopal

//Here 'i' indicates for 'i'th row and 'j' indicates
for 'j'th row
//Thus, the matrix is iXj with 3X2 size
//The result matrix should be 2X3

//The logic is as fallows

for(int j=0;j<2;J++)
{
for(int i=0;i<3;i++)
console.write(a[j,i]);
//After completing the first row it should be in the
next line
console.writeln("\n");
}

The final out put should be

2 1 3
2 2 4

Is This Answer Correct ?    8 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how do I convert a string to an int in c#?

522


How do I create a multi language, multi file assembly?

632


Explain more on CLR

757


What is the advantage of constructor in c#?

502


What is the implicit name of the parameter that gets passed into the set method/property of a class?

503






Explain the three services model (three-tier application). Presentation (ui), business (logic and underlying code) and data (from storage or other sources).

491


What is use of FormBoarderStyle Propertie

539


How many types of delegates are there in c#?

470


How to find the current application file path while runtime?

511


Please write a program to display “welcome to bestinterviewquestion.com” in c#?

538


What is object type in c#?

553


Can interface inherit class in c#?

497


What is the task perform by clr?

581


What are the Types of JIT and what is econo-JIT

802


What is a partial class. Give an example?

517