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 an escape sequence? Name some string escape sequences in c#.
When is a class declared as a class abstract?
What is data bind in c#?
What is a Command Object in C#?
Ho we can see assembly information?
Explain the use of Mutex in C#?
Give some examples of commonly used i/o classes?
What is serialization in dot net?
Do extension methods have to be static?
How does foreach loop work in c#?
Is is possible to force garbage collector to run?
What are some examples of desktop applications?
What is the difference between early binding and late binding in c#?
What is Implicit conversion in C#?
Why do we need to call CG.SupressFinalize?