Course of Raku / Essentials / Loops / Exercises

Digital stairs

Problem

Create a program that prints the following structure:

1
12
123
1234

The user must enter the size of the stairs (which does not exceed 9).

Example

An example of using this program with the input value 3:

$ raku digital-stairs.raku
Enter the size: 3
1
12
123

Solution

See the solution

Course navigation

Conditional checks / Ternary operator   |   Data type conversion

Translations of this page: EnglishDeutschEspañolItalianoLatviešuNederlandsБългарскиРусскийУкраїнська