This console program show how to print star pattern in C# like triangle pattern.
using System; using System.Collections.Generic; using System.Text; namespace starpatterns { class Program { static void Main(string[] args) { int value = 5; int i, j, k; Console.WriteLine("PRINTING THE STAR."); for (i = 1; i <= value; i++) { for (j = 1; j <= value-i; j++) { } for (k = 1; k <= i; k++) { Console.Write("*"); } Console.WriteLine(""); } Console.ReadLine(); } } }
PRINTING THE STAR. * * * * * * * * * * * * * * *