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

Why do we use void in c#?

877


If casting fails what type of exception is thrown?

891


What is an object pool in .net?

1060


Differentiate between method overriding from method overloading with its functionality?

1036


What is the namespace for datatable in c#?

969


Why do we need properties in c#?

894


Explain how obfuscator works in .net

1009


Describe the types of comments in c#?

907


What is string programming language?

867


What Is An Interface Class?

1064


What is executescalar in c#?

862


What is a data set in c#?

944


What are some of the commonly used commands in sqlcommand?

915


How do you create partial methods?

987


Explain states of a thread in c#?

974