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 code compilation in c#.
Is namespace a class?
What are callback methods in c#?
What is desktop example?
What is the difference between “finalize” and “finally” methods in c#?
Can a private virtual method can be overridden?
Explain about Serialize and MarshalByRef?
Is it possible to have different access modifiers on the get/set methods of a property?
What is the difference between static class and sealed class in c#?
What are primitive types in c#?
what are nullable types in c#
What all details the assembly manifest will contain?
How will you deploy the dll file in gac?
What is difference between destructor and finalize?
Can class be protected in c#?