C# program to print full Pyramid of Stars
Program
using System;
namespace FullPyramidOfStar
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Full Pyramid of Star- Equilateral Triangle");
Console.Write("Enter the number of rows:\t");
int rows = int.Parse(Console.ReadLine());
int i, j, k = 0;
for(i = 1; i <= rows; i++)
{
for(j = i; j < rows; j++)
{
Console.Write(" ");
}
for(k = 1; k < (i * 2); k++)
{
Console.Write("*");
}
Console.Write("\n");
}
}
}
}
Output
Full Pyramid of Star- Equilateral Triangle
Enter the number of rows: 5
*
***
*****
*******