Skip to content

Star triangle

Star triangle

Print a triangle of stars four rows high: one star, then two, then three, then four.

Multiplying a string repeats it: "ab" * 3 is "ababab". Let the loop variable say how many stars each row needs.

Log in or create account

IGCSE, A-Level & AP