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 a property c#?
Is char * null terminated?
Explain the types of Polymorphism.
Where are value types stored in c#?
How does dictionary work in c#?
What do you mean by saying a "class is a reference type"?
What’s a strong name?
What are access modifiers used for?
Why do we use parameters in c#?
From which base class do all Web Forms inherit from?
To catch any possible exception What is the C# syntax written ?
What do you mean by winforms in c#?
In a memory when you Box and Unbox a value-type what happens?
Explain acid rule of thumb for transactions in c#.
How do you determine whether a string represents a numeric value?