Write an algorithm to find the average age of group of 10 players
Answers
Answered by
7
Answer:
Start
Input ages of 10 players in array A[]
Sum = 0
I = 0
Repeat steps 6 & 7 while (I < 10)
Sum = Sum + A[I]
I = I + 1
Avg = Sum / 10
Print Avg
Stop
Answered by
6
The algorithm to find the average age of 10 players.
- N = 10 we are assigning a variable "N" directly to the number of players i.e., 10
- a = 1 we are using variable "a" to print the number of players in the count-wise system.
- SUM = 0 this command is used for the opting of sum ages of the players.
- While (a<=0):
Input AGE
add AGE to SUM
add 1 to a
AVG = SUM/N
Print("AVG")
In the above step, we are while loop as it prints the output repeatedly till the assigned value. The final answer is printed.
Similar questions