Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / raji

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is faster abstract class or interface in c#?

990


What is string class in c#?

890


How do you serialize in c#?

857


Explain the difference between directcast and ctype.

1004


How does insertion sort work?

924


What is a delegate? Explain.

944


What are modifiers in c#?

875


What is type keyword in c#?

916


what are the different ways a method can be overloaded?

925


What is an inheritance in c#?

884


What are extensions methods in c#?

883


Is it not possible to store a boolean value as a variable?

857


What is the difference between abstract and abstraction?

858


Name some string escape sequences in c#.

1041


What is difference between field and property in c#?

835