P3: Print Patterns
Simple Right-Angled Triangle Program
Console.Write("Enter the height of the triangle: ");
int triangleHeight = int.Parse(Console.ReadLine());
for (int row = 1; row <= triangleHeight; row++)
{
// Print stars for each row
for (int star = 1; star <= row; star++)
Console.Write("*");
Console.WriteLine();
}Explanation
Pyramid printing program
Explanation
Last updated