using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace diamonddemo { class Program { static void Main(string[] args) { Console.WriteLine("Program for displaying pattern of *."); Console.Write("Enter the maximum number of *: "); int n = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("\nHere is the Diamond of Stars\n"); for (int i = 0; i < n; i= i+2) { for (int j = 0; j<=i; j++) Console.Write("*"); Console.WriteLine(); } for (int i = n-1; i>=1; i=i-2) { for (int j = 0; j<(n-i); j++) Console.Write("*"); Console.WriteLine(); } Console.ReadLine(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)