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 can we prevent browser from caching an aspx page?

0 Answers  


What does mvc represent in asp.net? : asp.net mvc

0 Answers  


What are the new features implemented in ASP.NET?

0 Answers   TCS,


How do you define authentication in Web.Config?

2 Answers   Accenture, BirlaSoft, IBM,


What is the difference between mvc and asp.net? : Asp.Net MVC

0 Answers  






What does this do? gacutil /l | find /i about

1 Answers  


if i have a web page, and after the postback i dont to maintain the viewstate. How can we maintain in web application?

4 Answers   CGI,


What is variable and constant in .net programming language?

0 Answers  


How to remove themes from certain controls?

2 Answers  


What is a 401 redirect?

0 Answers  


What is the difference between the asp and asp.net?

0 Answers  


why we are using delegates and in which condition it is required?

3 Answers   TCS,


Categories