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

Can a method return multiple values in c#?

862


What are c# collections?

902


What are the fundamental principles of oo programming?

1103


What is private and shared assembly?

994


What is windows application in c#?

907


What is difference between private, protected, and public in C#?

1052


What is binding in c#?

902


Write down the c# syntax to catch an exception

929


What is difference between abstraction and encapsulation in c#?

1017


Why do I get an error (cs1006) when trying to declare a method without specifying a return type?

935


What is the default value of guid in c#?

881


What is iqueryable and ienumerable in c#?

947


What is the difference between finalize() and dispose() methods?

985


What is dll in vb.net?

937


What is an event in c#?

889