Course of Raku / Essentials / Numbers / Exercises

Number of tens

Problem

Create a program that asks to enter a positive integer number and prints the digit corresponding to the number of tens in it.

Example

For example, in the input number 234, the number of tens is 3, so the program prints 3:

$ raku tens.raku
Enter a positive integer number: 234
3

Solution

See the solution

Next exercise

💪 The value of π

Course navigation

Strings / String length   |   Boolean type

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