
7 Different Star Pattern Programs in C#
Pattern 1:
******** ******* ****** ***** **** *** ** *
public class Program
{
public static void Main(string[] args)
{
for (int row = 8; row >= 1; --row)
{
for (int col = 1; col <= row; ++col)
{
Console.Write("*");
}
Console.WriteLine();
}
}
}
Pattern 2:
* ** *** **** ***** ****** ******* ********
public class Program
{
public static void Main(string[] args)
{
for (int row = 1; row <= 8; ++row)
{
for (int col = 1; col <= row; ++col)
{
Console.Write("*");
}
Console.WriteLine();
}
}
}
Pattern 3:
public class Program
{
public static void Main()
{
int number, i, k, count = 1;
Console.Write("Enter number of rows\n");
number = int.Parse(Console.ReadLine