public static void Main(string[] args)
Console.WriteLine("Enter the height of the figure: ");
string input = Console.ReadLine();
if (!Int32.TryParse(input, out height))
Console.WriteLine("Not a Number !");
public static void printPattern1(int height)
bool isEven = false, xInserted = false;
for (int line = 1; line < height + 1; line++)
int count = 0, decrement = 0;
if (!isEven && line == Math.Ceiling((double)height / 2) && !xInserted)
decrement = (line) - height / 2;
count = 0 - (decrement - 1) * 2;
while (count < height - (line * 2))