Exercise 5.3

From Earlham CS Department
Revision as of 17:22, 27 September 2009 by Erika (talk | contribs) (New page: <pre> #!/usr/bin/perl use strict; use warnings; #Erika Phelps #Sept 27, 2009 #Exercise 5.3 #Pseudocode: #Initialize a count. #For count < 101, add one to the count and print this valu...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


#!/usr/bin/perl
use strict;
use warnings;

#Erika Phelps
#Sept 27, 2009
#Exercise 5.3

#Pseudocode:

#Initialize a count.
#For count < 101, add one to the count and print this value.
#Exit program when the first 100 numbers have been printed.

#Define variables

my $count = 0;

#Initialize the loop

while ($count < 101) {

    $count++;

    print "$count\n";
}

exit;


#Why does it print 101?