class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the number of row");
int n = int.Parse(Console.ReadLine());
for (int row = 0; row < n; row++)
{
for (int coll = 0; coll < (n * 4); coll++)
{
if (coll <= row || (coll >= n && coll <= (n * 2) - (row + 1))
|| (coll >= n * 2 && coll >= (n * 2) + row && coll < n * 3)
|| (coll >= (n * 4) - (row + 1))
)
{
Console.Write("*");
}
else
{
Console.Write(" ");
}
}
Console.WriteLine();
}
Console.ReadLine();
}
}
No comments:
Post a Comment