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
- Program for multiplication of array elements
- Count number of even and odd elements in an array
- Program to print Sum of even and odd elements in an array
- Count the number of elements in an array which are divisible by k
- Product of all pairwise consecutive elements in an Array
- Program to print product of even and odd indexed elements in an Array
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.