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

What is the need of client side and server side validation ?

1 Answers   Keane India Ltd,


What event fired during, when datagrid click?

1 Answers  


How you will handle session when deploying application in more than a server? Describe session handling in a webfarm, how does it work and what are the limits?

3 Answers   CoreObjects,


What is the default Orientation property in a Menu control?

0 Answers   Sans Pareil IT Services,


How does VB.NET/C# achieve polymorphism?

6 Answers   Siebel Systems,


Is it possible for me to change my aspx file extension to some other name?

0 Answers  


How to prepare culture-specific formatting in .net.

0 Answers  


5. What three Specific Job Positions do you target from Swatz Oils GROUP U.K?

0 Answers   Swatz Oils,


Explain the difference between asp.net mvc and asp.net webforms

0 Answers  


Is LINQ performance wise better or using sqlcommand?

1 Answers  


If cookies is disabled in client browser will session work ?

7 Answers   Satyam,


We have 2 sites in which one site allows the user with out asking credentials and second one ask for credentials through a log page. What might be the configurations settings for both sites? We can use IIS and web.config files together.

1 Answers   ADITI,


Categories