Course of Raku / Essentials / Conditional checks / Exercises

FizzBuzz

Problem

Here is a simplified version of the standard FizzBuzz problem.

Create a program that asks to enter a positive integer number and prints:

  • Fizz if the number is divisible by 3.
  • Buzz if the number is divisible by 5.

Example

When you run the program, it prompts to enter a number, and then prints the result.

$ raku fizz-buzz.raku
Enter a number: 10
Buzz

Solution

See the solution

Next exercise

💪 How many numbers are equal?

Course navigation

Code blocks / Local variables   |   Loops

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