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

Define static function?

0 Answers  


How to Page Execute in asp.net(inside browser)

1 Answers   Satyam, Wipro,


Explain login controls.

0 Answers  


how to write code for role based security

2 Answers  


Various types of Page Load functions

4 Answers   Net Solution,






Define an assembly?

9 Answers   Siebel,


Give an example of what might be best suited to place in the application_start and session_start subroutines?

0 Answers  


What is caching? Explain.

0 Answers  


In the Repeater control which way you can edit?

0 Answers   Siebel,


When maintaining session through Sql server, what is the impact of Read and Write operation on Session objects? will performance degrade..

3 Answers   Allsec Technologies,


What is a Windows Service and how does its lifecycle differ from a "standard" EXE?

2 Answers  


Explain cashing in asp.net.

0 Answers  


Categories