You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
@a = (1, 2, 3, 4, 5, 6, 7, 8, 9);
|
|
$running_sum = 0;
|
|
|
|
for ($loop_index = 0; $loop_index <= $#a + 1; $loop_index++) {
|
|
$running_sum += $a[$loop_index];
|
|
}
|
|
|
|
print "Average value = " . $running_sum / ($#a + 1); |