Saturday, December 26, 2009

How do I write an algorithm to find the average of 5 numbers using array ?

The algorithm should be able to Accept 5 numbers in an array and find the sum and find the average of the numbers.





ThanksHow do I write an algorithm to find the average of 5 numbers using array ?
Once you have the numbers in an array and have calculated the sum, you just divide the sum by 5 to get the average.





You will probably want the minimum and maximum next.

No comments:

Post a Comment