Ask Question
31 December, 14:19

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

+4
Answers (1)
  1. 31 December, 14:35
    0
    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
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Associate the average of the numbers from 1 to n (where n is a positive integer value) with the variable avg. ...” in 📗 Mathematics if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers