using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { try { string i; string j; int m; int n; int no_of_rows = 0; int no_of_columns = 0; Console.WriteLine("Enter the number of rows "); i = Console.ReadLine(); no_of_rows = Convert.ToInt32(i); Console.WriteLine("Enter the number of columns "); j = Console.ReadLine(); no_of_columns = Convert.ToInt32(j); for (n = 0; n < no_of_rows; n++) { for (m = 0; m < no_of_columns; m++) { Console.Write(n.ToString()+m.ToString()+" "); } Console.WriteLine(" \n "); } } catch (Exception e) { Console.WriteLine("Exception occured: " + e.Message); } } } }
Enter the number of rows 4 Enter the number of columns 4 00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33