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
What is xml serialization and deserialization in c#?
What is a class c#?
What is delegates in c# and uses of delegates?
Why do we write system in c#?
What is the solution if you need to manipulate sets of items?
What is difference between asp net and c# net?
What is anonymous types in c#?
What is the use of ienumerable in c#?
Can we set image Source dynamically using C# in WPF application?
What are the Types of configuration files and their differences
Is c# easier than c++?
How is the syntax written to inherit from a class in C#?Give an example ?
What does xpath return?
What is delegation in oops?
What is a void c#?