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
Can a method return multiple values in c#?
What are c# collections?
What are the fundamental principles of oo programming?
What is private and shared assembly?
What is windows application in c#?
What is difference between private, protected, and public in C#?
What is binding in c#?
Write down the c# syntax to catch an exception
What is difference between abstraction and encapsulation in c#?
Why do I get an error (cs1006) when trying to declare a method without specifying a return type?
What is the default value of guid in c#?
What is iqueryable and ienumerable in c#?
What is the difference between finalize() and dispose() methods?
What is dll in vb.net?
What is an event in c#?