Course of Raku / Essentials / 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

Data type conversion / Converting types with prefix operators   |   Positional data types