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