Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp3
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Row = ");
- int row = int.Parse(Console.ReadLine());
- Console.Write("Column = ");
- int col = int.Parse(Console.ReadLine());
- int[,] arr = new int[row, col];
- for (int i = 0; i < row; i++)
- {
- for (int j = 0; j < col; j++)
- {
- Console.Write("arr[{0},{1}] = ",i,j);
- arr[i,j] = int.Parse(Console.ReadLine());
- }
- }
- for (int i = 0; i < arr.GetLength(0); i++)
- {
- for (int j = 0; j < arr.GetLength(1); j++)
- {
- Console.Write(arr[i,j] + " ");
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement