lwilliams2954 lwilliams2954
  • 17-02-2018
  • Mathematics
contestada

Associate the average of the numbers from 1 to n (where n is a positive integer value) with the variable avg.

Respuesta :

pbzepplin
pbzepplin pbzepplin
  • 27-02-2018
This is a simple programming question. To calculate the average of any two numbers, where one number is 1 and the other is n, simply add the two numbers and divide by 2. Therefore, the answer is:
avg = (1 + n) / 2 
Answer Link

Otras preguntas

A market buys mixed nuts at $15 per pound. They want to make a $20 profit.what would you pay for 1 pound of nuts?
Seven days ago, I put 60 jelly beans in a bowl. Now there are 4 jelly beans left.If I ate the same number of jelly beans each day, how many jelly beans did I ea
okay i got a few questions 1 can a short story be written in first pov? 2 is it bad to write a short story off of something like a show or movie? 3 if i do wri
A man riding his bike had a velocity of 5 meters per second north. After 10 seconds, his velocity increased to 9 meters per second north. What was his average a
m∥n, m∠1 = 50°, m∠2 = 48°, and line s bisects ∠ABC. What is m∠3?
What is the probability that a student prefers chocolate given that the students is a girl?
Why did Rome fall and what was the short term and long term effects of their demise?
What country controlled the land at the time of Brazil's independence in 1822? The French, following Napolean's control of Europe The Spanish, who had taken o
what is 10 + 10? I am testing out how this app works
Which stament best describes the forces of an object moving up upward?