Given an array of numbers, print all those elements that are greater than average.
Input : 5, 4, 6, 9, 10 Output : 9 10 Explanation: avg = 5 + 4 + 6 + 9 + 10 / 5; avg = 34 / 5 avg = 6.8 Elements greater than 6.8 are 9 and 10 Input : 1, 2, 4, 0, 5 Output : 4 5
1) Find average of elements.
2) Traverse array again and print elements that are greater than average,
- Find the first, second and third minimum elements in an array
- Program to find sum of elements in a given array
- Average numbers in array
- Find the average of first N natural numbers
- Find the Next perfect square greater than a given number
- Divide every element of one array by other array elements
- Sum of array elements using recursion
- Sum of consecutive two elements in a array
- Sum of array Elements without using loops and recursion
- Count number of even and odd elements in an array
- Program for multiplication of array elements
- Program to print Sum of even and odd elements in an array
- Product of all pairwise consecutive elements in an Array
- Count the number of elements in an array which are divisible by k
- Program to find the smallest element among three elements
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.