using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace csharp { class Program { static void Main(string[] args) { Console.WriteLine("Enter the number"); int n = Convert.ToInt32(Console.ReadLine()); for (int i = 1; i <= n; i++) { int j; for (int k = 1; k <= n - i; k++) { Console.Write(" "); } for (j = 1; j <= i; j++) { Console.Write("" + j); } for (int s = j - 2; s >= 1; s--) { Console.Write("" + s); } Console.WriteLine(""); } Console.ReadLine(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)