Course of Raku / Essentials / Conditional checks / Exercises

How many numbers are equal?


Create a program that takes three integer numbers from the user and tells how many of them are equal. The program should be able to work with both positive and negative numbers.


A possible run of the program is shown below:

$ raku how-many-equal-numbers.raku
Number 1: 3
Number 2: -4
Number 3: 3

If all three numbers are different, the program prints 0.


See the solution

Next exercise

💪 Leap year

Course navigation

Code blocks / Local variables   |   Loops