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 usercontrol how we can use acess the controls that are present in the usercontrol in the aspx page suppose we have 2 text boxes in a user control how u can acess the 2 textboxs in the aspx page

1 Answers  


Can we have multiple worker process in an ASP.NET application? If so then how it has been handled by application? And who handles it?

0 Answers   InfoAxon Technologies,


Explain the basic functionality of garbage collector?

0 Answers  


What are the two properties that are common in every validation control?

4 Answers   Siebel,


How do you relate an aspx page with its code behind page ?

4 Answers   Accenture, BirlaSoft,


Explain the working of passport authentication.

0 Answers  


What is difference between rest and soap?

0 Answers  


What is the use of execute non query in asp.net?

0 Answers  


What is content place holder?

0 Answers  


Where can I get information on cookies in asp.net?

0 Answers  


Which is the best institute in Hyderabad/Secunderabad/Andhra Pradesh to learn DotNet?

0 Answers  


I have a method written in WebForm (means .aspx page) & now I want to call this method in WebUserControl (means .ascx page) what should I have to do?

0 Answers   Patni,


Categories