The do/while and do/until Loops : Do While « Statement « Perl






The do/while and do/until Loops


#!/usr/bin/perl
$x = 1;
do {
    print "$x ";
    $x++;
} while ($x <= 10);
print    "\n";

$y = 1;
do {
    print "$y " ;
    $y++;
} until ($y > 10);

 








Related examples in the same category

1.Using the do/while repetition structure
2.Do .. while statement
3.Print out even numbers with a do...while loop
4.A do statement.