#!/usr/bin/perl
$done = 0;
$counter = 1;
print ("This line is printed before the count starts. \n");
while ($done == 0)
{
print ("The value of count is ", $counter, "\n");
if ($counter == 25)
{
$done = 1;
}
$counter = $counter + 1;
}
print ("End of counting. \n");
Execution
This line is printed before the count starts.
The value of count is 1
The value of count is 2
The value of count is 3
The value of count is 4
The value of count is 5
The value of count is 6
The value of count is 7
The value of count is 8
The value of count is 9
The value of count is 10
The value of count is 11
The value of count is 12
The value of count is 13
The value of count is 14
The value of count is 15
The value of count is 16
The value of count is 17
The value of count is 18
The value of count is 19
The value of count is 20
The value of count is 21
The value of count is 22
The value of count is 23
The value of count is 24
The value of count is 25
End of counting.
No comments:
Post a Comment