Posted on
22 Sep 2014 01:19 PM IST
Console.WriteLine("Please enter number:");
string number = Console.ReadLine();
int a = 0;
if (Int32.TryParse(number, out a)) { int n = Convert.ToInt32(number);
for (int b = 0; b <= n; b++) Console.Write("**"); Console.WriteLine(""); for (int i = 1; i <= n; i++) { int temp = i; int t = 0; for (int j = 1; j <= n; j++) {
if (i > n) { Console.Write(++t + " "); } else
Console.Write(i++ + " "); } Console.WriteLine(""); i = temp; }
for (int c = 0; c <= n; c++) Console.Write("**"); } else Console.WriteLine("You enter value not interger..!");
Console.ReadLine();
|