How to transpose rows into columns and columns into rows in
a multi-dimensional array?

Answer Posted / raji

int [,]array=new int[2,2] {{1,2},{3,4}};

transpose of the array is

for(int i=0;i<2;i++)
{
for(int j=0;j<2;j++)
{
Console.Write("{0} ",a[j,i]);
}
}

o/p : 1 3
2 4

Is This Answer Correct ?    20 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between abstract class and interface in c#?

482


What is check/uncheck?

587


How do I make a dll in c#?

496


What do you mean by casting a data type?

540


What is c# in asp net?

480






What is Implicit conversion in C#?

557


Can a sealed class be used as a base class?

524


Is double a decimal?

510


What is the wildcard character in sql?

516


Illustrate the differences between the system.array.copyto() and system.array.clone()?

505


Why do we parse in c#?

460


Name the method of servicebase class?

530


What is delegate in c#?

535


What is arraylist c#?

453


What is a console file?

476