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

Which quantity would not be labeled with a vector? A. kilometers/hour B. miles/hour C. miles/gallon D. centimeters/second
Find all zeros (both real and complex) for the function f(x)=x^3-5x^2+4x+10
How would you algebraically factor x squared minus 15?
Can you solve for t in -100=12t-4?
what is washroom in french
A solution containing 30% insecticide is to be mixed with a solution containing 50% insecticide to make 200 L of a solutions containing 42% insecticide. How muc
Are all equilateral quadrilaterals similar?
How many subsets does the set {1, 2, 3} have?
4 friends share 3 apples equally. What fraction of the apple does each friend get ?
what is 307,495 rounded to the nearest thousand and how do I figure it?