Course of Raku / Essentials / Variables and data types 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

See the solution

Course navigation

Solution: The value of π   |   Solution: The last digit

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