Generation

generate functionThu, 17 Nov 2022

Draw a triangle

public static void DrawTriangle(int N) { for (int row = 1; row <= N; row++) { for (int col = 1; col <= row; col++) { Console.Write("*"); } Console.WriteLine(); } }

Questions about programming?Chat with your personal AI assistant