Course of Raku / Essentials / Numbers / Exercises
The last digit
Problem
Write a program that asks to enter a positive integer number and prints its last digit.
Example
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.
Solution
Next exercise
Course navigation
← Strings / String length | Boolean type →
Translations of this page: English • Deutsch • Español • Italiano • Latviešu • Nederlands • Български • Русский • Українська