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

Factoring trinomials word problems.
My question is, what is:  log6(4x-8)=3
can somebody help me solve Y=9X+6
The battles in the revolutionary war and the blanks aren't filled.
The type of bond between atoms of potassium and chloride in a crystal of potassium chloride a. hydrogen bond b. ionic bond c. polar covalent bond d. pure co
HELP ME WITH This page?!?
what were the patriots concerned about when the war was over and they had won
Factoring trinomials word problems.
The battles in the revolutionary war and the blanks aren't filled.
Solve- 3y - 7 =8     I cannot figure this out!!! I have no idea how to do this either. ?.. help?!
good job