int intLines; string str; TextReader txtReader; txtReader = Console.In; Console.WriteLine("How many lines need to be displayed?"); intLines = Convert.ToInt16(txtReader.ReadLine()); Console.WriteLine("Enter the character to be placed as triangle?"); str = txtReader.ReadLine(); Console.Clear(); StringBuilder strBuilder = new StringBuilder(str); int intCursorYposition = 0; int intCursorXposition = Console.BufferWidth / 2; for (int i = 0; i < intLines; i++) { if (i % 2 != 0) { intLines++; strBuilder.Append(str); continue; } try { Console.SetCursorPosition(intCursorXposition, intCursorYposition); }