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
Which is faster abstract class or interface in c#?
What is string class in c#?
How do you serialize in c#?
Explain the difference between directcast and ctype.
How does insertion sort work?
What is a delegate? Explain.
What are modifiers in c#?
What is type keyword in c#?
what are the different ways a method can be overloaded?
What is an inheritance in c#?
What are extensions methods in c#?
Is it not possible to store a boolean value as a variable?
What is the difference between abstract and abstraction?
Name some string escape sequences in c#.
What is difference between field and property in c#?