Course of Raku / Essentials / Loops / Exercises

Fibonacci numbers

Problem

Create a program that prints the first 20 Fibonacci numbers.

Example

When you run the program, it should print the first Fibonacci numbers:

$ raku fibonacci-numbers.raku
0
1
1
2
3
5
8
13
. . .

Solution

See the solution

Next exercise

💪 Echo until enough

Course navigation

Conditional checks / Ternary operator   |   Data type conversion