Course of Raku / Essentials / Numbers / Exercises

The last digit


Write a program that asks to enter a positive integer number and prints its last digit.


Here is the possible script of interacting with the program:

$ raku the-last-digit.raku
Enter a number: 123
The last digit of 123 is 3.


See the solution

Next exercise

💪 Sum of numbers from 1 to 100

Course navigation

Strings / String length   |   Boolean type