in reply to Average/mean calculator
print "In this version you can use up to TEN NUMBERS! \n"; print "when you have entered the numbers you need type 'end' \n"; my $count = 1; my $total = 0; while ($count <= 10) { print "Enter number $count "; my $num = <STDIN>; chomp $num; last if $num eq "end"; $total += $num; $count++; } print " Average is: ", $total / $count, "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Average/mean calculator
by Paradizingmania (Initiate) on Jun 04, 2014 at 18:54 UTC | |
by roboticus (Chancellor) on Jun 04, 2014 at 20:13 UTC | |
by Laurent_R (Canon) on Jun 04, 2014 at 20:23 UTC |