98.8k views
2 votes
Write code that displays the average of five numbers.

1 Answer

6 votes

Final answer:

To find the average of five numbers, add up all the numbers and divide the sum by the total number of numbers.

Step-by-step explanation:

To find the average of five numbers, you need to add up all the numbers and then divide the sum by the total number of numbers. Here is an example:

  1. Let's say the five numbers are 10, 15, 20, 25, and 30.
  2. Add up all the numbers: 10 + 15 + 20 + 25 + 30 = 100
  3. Divide the sum by the total number of numbers: 100 / 5 = 20

So, the average of the five numbers is 20.

User Essex Boy
by
6.8k points