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 Constructor and destructor?
How does bubble sort work?
What are native methods?
What are the types in c#?
Why do we need generics?
Why singleton class is sealed in c#?
Can you call from an inherited constructor to a specific base constructor if both base class and an inheriting class has a number of overloaded constructors?
What are native functions?
What is an enumerator c#?
What is class and object c#?
What is an int c#?
What is type keyword in c#?
Why main method is static in c#?
What is the default modifier for class in c#?
What is type cast in C#?