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
Explain how do I convert a string to an int in c#?
How do I create a multi language, multi file assembly?
Explain more on CLR
What is the advantage of constructor in c#?
What is the implicit name of the parameter that gets passed into the set method/property of a class?
Explain the three services model (three-tier application). Presentation (ui), business (logic and underlying code) and data (from storage or other sources).
What is use of FormBoarderStyle Propertie
How many types of delegates are there in c#?
How to find the current application file path while runtime?
Please write a program to display “welcome to bestinterviewquestion.com” in c#?
What is object type in c#?
Can interface inherit class in c#?
What is the task perform by clr?
What are the Types of JIT and what is econo-JIT
What is a partial class. Give an example?