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
What is the benefit of dependency injection c#?
What is use of a HashTable in .NET?
How does dependency injection work c#?
How garbage collection deals with circular references.
Why we use anonymous methods in c#?
Does c# support multiple inheritance (mi)?
What is hierarchical inheritance in c#?
Can you have parameters for static constructors?
Why array is faster than arraylist in c#?
How to use the sreamReader class to read form a text file?
Is c# a technology?
What is winforms c#?
How to declares a two-dimensional array in C#?
What is the best dependency injection c#?
What is difference between method overriding and method overloading?