Write a program in C# that asks for a symbol and a width to paint a triangle of that width and height using that number to draw it.
public class DrawTriangle
public static void Main(string args)
int x = Convert.ToInt32(Console.ReadLine());
int width = Convert.ToInt32(Console.ReadLine());
int height = width;
for (int row = 0; row < height; row++)
for (int column = 0; column < width; column++)
Practice C# anywhere with the free app for Android devices.
Learn C# at your own pace, the exercises are ordered by difficulty.
Own and third party cookies to improve our services. If you go on surfing, we will consider you accepting its use.