Course of Raku / Essentials / Control flow essentials / Loops / Exercises
Division via subtraction
Problem
Create a program that implements integer division via subtraction. The program has hard-coded numbers:
my $a = 175;
my $b = 25;Complete the program so that it prints the integer part of
$a / $b. Use a loop and subtraction only.
Example
$ raku division-via-subtraction.raku
7Solution
Course navigation
← Solution: Echo until enough | Solution: Division via subtraction →
Translations of this page: English • Deutsch • Español • Italiano • Latviešu • Nederlands • Български • Русский • Українська