Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- int[,] a = new int[10, 10];
- int[,] b = new int[10, 10];
- int m, n;
- Console.WriteLine("Enter the rows and coulms of Matrix");
- m = Convert.ToInt16(Console.ReadLine());
- n = Convert.ToInt16(Console.ReadLine());
- Console.WriteLine("Enter the Values of Matrix");
- for (int i = 0; i < m; i++)
- {
- for (int j = 0; j < n; j++)
- {
- a[i,j] = Convert.ToInt16(Console.ReadLine());
- }
- }
- Console.WriteLine("Matrix A");
- for (int i = 0; i < m; i++)
- {
- for (int j = 0; j < n; j++)
- {
- Console.Write(a[i,j] + "\t");
- }
- Console.WriteLine();
- }
- Console.WriteLine("Transpose Matrix");
- for (int i = 0; i < m; i++)
- {
- for (int j = 0; j < n; j++)
- {
- b[i, j] = a[j, i];
- Console.Write(b[i,j] + "\t");
- }
- Console.WriteLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment