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
Why do we use void in c#?
If casting fails what type of exception is thrown?
What is an object pool in .net?
Differentiate between method overriding from method overloading with its functionality?
What is the namespace for datatable in c#?
Why do we need properties in c#?
Explain how obfuscator works in .net
Describe the types of comments in c#?
What is string programming language?
What Is An Interface Class?
What is executescalar in c#?
What is a data set in c#?
What are some of the commonly used commands in sqlcommand?
How do you create partial methods?
Explain states of a thread in c#?