Course of Raku / Essentials / Functions essentials / Built-in functions for printing / Exercises

Print the warning

Problem

Create a program that asks for your age and prints one or two warnings if the entered value is negative. Make sure the warning is printed to STDERR.

Example

A couple of possible cases:

$ raku print-the-warning.raku
What is your age? 20
Your age is 20

$ raku print-the-warning.raku
What is your age? -1
You entered a negative number!

Solution

See the solution

Course navigation

Solution: Compare say and put   |   Solution: Print the warning

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