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 do you mean by stack and heap in c#?
What is activator c#?
What is addressof operator?
Why do we need ienumerable in c#?
What does firstordefault mean in c#?
What is difference between field and property in c#?
What are the different types of comments in c#?
What do you know about WM_CHAR message?
What is the difference between iqueryable and ienumerable?
What is file extension of webservices?
What is dependency injection?
Explain the security with aop?
Why dictionary is used in c#?
Explain the ways to deploy an assembly?
Why do we use dictionary in c#?