Course of Raku / Essentials / More about types / Typed variables / Exercises

Converting user input to a number

Problem

Write a program that asks the user to enter an integer number and saves it in a typed variable. Print the entered number.

Example

This program runs in the following way:

$ raku input-number.raku
Enter a number: 42
42

Solution

See the solution

Course navigation

Solution: Examine the result of prompt — Numbers   |   Solution: Converting user input to a number

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