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



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

Answer / kalpana

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 ?    1 Yes 1 No

Post New Answer

More ASP.NET Interview Questions

How do I publish my asp.net application to my isp's web server?

0 Answers  


What are the asp.net security controls?

0 Answers  


Explain asp.net mvc request life cycle? : asp.net mvc

0 Answers  


Which namespace do the classes, allowing you to support COM functionality, are located?

1 Answers  


What is the advantage of using Windows authentication in a Web application?

0 Answers   MCN Solutions,


What is the difference between the get method () and post method ()?

0 Answers  


what are the oops concepts are used in your project?

1 Answers   AppShark, IBM, Kotak,


What is the difference between abstract class vs interface? Can give me the real time examples?

0 Answers  


Difference between application and session ?

12 Answers   DataPoint, Satyam,


about view state and how validation controls will be executed on client and server

3 Answers   Wipro,


Diff B/W user control and server control

3 Answers  


How to check null values in dataset ?

6 Answers   Digital GlobalSoft,


Categories