Skip to main content

Posts

Showing posts from August, 2010

Triangle shape in one loop

            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; ...