1-D Array - Average me | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 3

1-D Array - Average me

There are N trees in Terry's front yard. He is supposed to measures the height of each tree and find the average height of trees in his yard. What is the average height of a tree in Terry's front yard? Note:- Print your answer as floor value (average height) Input The first line contains N: numbers of tree. Then follows N lines represents the height of each tree. Constraint:- 1 <= n <= 100000 1 <= a[i] <= 100000 Output Print the average height of all the trees in the yard Example Input 5 6 8 34 9 3 Output 12 Explanation:- Sum of heights =60 Average of heights =60/5 Sample Input: 3 1 2 3

15th Nov 2021, 6:59 AM
Ashish Kumar Maurya
Ashish Kumar Maurya - avatar
2 Answers
+ 1
Ashish Kumar Maurya Show your attempts. You have already completed course.
15th Nov 2021, 10:20 AM
A͢J
A͢J - avatar
+ 1
I have deleted my solution for the problem, since Q&A Discussions isnt a platform for challenges, if u want to post challenges post it in feed.
15th Nov 2021, 1:27 PM
ACE
ACE - avatar