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

In the 1960s, american men had to register for the draft if they were between the ages of 18 and 25. 19 and 27. 20 and 29. 21 and 31.
Read the paragraph. 1) When the time came to go home, I could not open my locker. 2) In my last period gym class, I hurt my ankle. 3) Today was a day when every
HELPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
Imagine you are walking through your workplace. For some people there, it is appropriate to use tú, but for others it is more appropriate to use usted. Write a
list 3 compounds of a computer. list the 4 compounds of a computer system. The central component system houses, the processer, memory and what else? What are th
Using the slope formula, find the slope of the line through the given points. (1-6) and (-1-6)
Why was the Day of the Dead originally celebrated mainly in the Mexican countryside, but in the late 20th century it was also celebrated by the cities?​
how does the de family's rejection of the monster drive the plot of the excerpt?
What do you now know about 20th Century Art, Abstract Art, Cubism, and Shapes? Give a short description of each.
pls help me thank you