Course of Raku / Essentials / Positional data types / Exercises

Square and cube

Problem

Create a program that prints the square and cube of an integer number that is passed to the program as a command-line argument.

Example

An example of using the program:

$ raku square-and-cube.raku 5
25
125

Solution

See the solution

Next exercise

💪 Traffic lights

Course navigation

Typed variables / Allomorphs   |   Associative data types