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


Please Help Members By Posting Answers For Below Questions

What is a property c#?

591


Is char * null terminated?

608


Explain the types of Polymorphism.

665


Where are value types stored in c#?

596


How does dictionary work in c#?

556






What do you mean by saying a "class is a reference type"?

592


What’s a strong name?

605


What are access modifiers used for?

694


Why do we use parameters in c#?

585


From which base class do all Web Forms inherit from?

600


To catch any possible exception What is the C# syntax written ?

615


What do you mean by winforms in c#?

576


In a memory when you Box and Unbox a value-type what happens?

626


Explain acid rule of thumb for transactions in c#.

594


How do you determine whether a string represents a numeric value?

597