Pyramid Question
Hey there, new to coding. I was running through methods and the software had a pyramid program to follow, the code is below. The issue is that the pyramid isn't spaced properly and I'd love to understand how to fix it. Can you help me? static void DrawPyramid(ref int n) { for (int i = 1; i <= n; i++) { for (int j = i; j < n; j++) { Console.Write(" "); } for (int k = 1; k <= 2 * i - 1; k++) { Console.Write("*" + " "); } Console.WriteLine(); } } static void Main(string[] args) { do { Console.Write("How big would you like your pyramid: "); int z = Convert.ToInt32(Console.ReadLine()); DrawPyramid(ref z); } while (true); { } }