mohammadshanzidulhoq mohammadshanzidulhoq
  • 09-03-2021
  • Computers and Technology
contestada

Write an algorithm to find the average of three numbers: 10, 20, 30

Respuesta :

Аноним Аноним
  • 09-03-2021

Language: JavaScript

Answer:

let num = [10,20,30];

average(num);  

function average(num) {

 let sum = 0;

 for(let i in num) {

   sum += num[i];

 }  

 return console.log(sum/num.length);

}

Answer Link

Otras preguntas

Question 9 of 25 What is the probability that out of 250 bables born, 130 or fewer will be boys? Assume that boys and girls are equally probable, and round your
Write the absolute value equations in the form |x-b|=c(where b is a number and c can be either number or an expression) that have the following solution sets:
The diagram is a model of festival grounds having three square stages and a triangular food court. The festival director wants to place a square booth in the in
The New Horizons satellite is currently travelling at a speed of 35,000 mph (miles per hour). How many miles can it travel in one day?
Determine the surface area of the rectangular prism.
POSSIBLE POINTS 9 In the text, the author questions whether or not the criminal justice system is doing what it was intended to do. What steps do you think we c
To investigate the relationship between age and preference for two mayoral candidates in an upcoming election, a random sample of city residents was surveyed. T
What are the two types of observations? Subjective Observation Data Based Observation Analysis Observation Objective Observation
Solve for x in the picture below
Marissa works in a bread shop every hour