Course of Raku / Essentials / Numbers / Exercises

Class desks

Problem

A school is preparing for the year after coronavirus and is going to order new desks. A desk is designed for two students. Given the number of students in the class, print the smallest possible number of desks that the school must buy for the class.

Use a variable to hardcode the number of students.

Example

Here is the first line of the program:

my $students = 23;
# Your code here . . .

When you run the program, you should get the following:

$ raku class-desks.raku
12 desks must be bought.

Solution

See the solution

Next exercise

💪 Number of tens

Course navigation

Strings / String length   |   Boolean type