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

What is the benefit of dependency injection c#?

862


What is use of a HashTable in .NET?

1105


How does dependency injection work c#?

889


How garbage collection deals with circular references.

821


Why we use anonymous methods in c#?

897


Does c# support multiple inheritance (mi)?

893


What is hierarchical inheritance in c#?

916


Can you have parameters for static constructors?

899


Why array is faster than arraylist in c#?

950


How to use the sreamReader class to read form a text file?

949


Is c# a technology?

867


What is winforms c#?

925


How to declares a two-dimensional array in C#?

986


What is the best dependency injection c#?

839


What is difference between method overriding and method overloading?

997