using System;
public class Program
{
public static void Main()
int row = 5;
PrintPyramid(row);
}
static void PrintPyramid(int row)
// Outer loop to handle number of rows
for (int i = 0; i < row; i++)
// Inner loop to handle number of spaces
for (int j = row - i; j > 1; j--)
Console.Write(" ");
// Inner loop to handle number of columns
for (int j = 0; j <= i; j++)
Console.Write("* ");
Console.WriteLine();