sempombili21
sempombili21 sempombili21
  • 06-03-2022
  • Computers and Technology
contestada

Write an algorithm to calculate the average
value of array of integer elements

Respuesta :

sparshsrivastava
sparshsrivastava sparshsrivastava
  • 06-03-2022

Answer:

Explanation: Input : arr[] = {1, 2, 3, 4, 5}

Output : 3

Sum of the elements is 1+2+3+4+5 = 15

and total number of elements is 5.

So average is 15/5 = 3

Input : arr[] = {5, 3, 6, 7, 5, 3}

Output : 4.83333

Sum of the elements is 5+3+6+7+5+3 = 29

and total number of elements is 6.

So average is 29/6 = 4.83333.

Answer Link

Otras preguntas

Bonnie has a problem with her bill from her trip to the emergency room. She calls the main number of the hospital. The hospital operator listens politely and tr
List 5 new laws that effected the colonies
In computer logic what is order of instructions
The nurse is reinforcing discharge instructions to the parents of a 2-year-old child who sustained accidental burns from a hot cup of coffee. The nurse determin
7(5 - 6x) - 4x =-8 + 35 show work
A manager pays $5,000 per month plus 2% of total monthly sales to the owner of the buiilding that houses the manager's restaurant. How much will the manager hav
How does active transport differ from all other forms of transportation
How do you slove 57 × 2000 with multiplying with powers of ten
who is john dalton,jj Thompson
what happens after a cesarean​