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,
- Count of greater elements for each element in the Array
- Average numbers in array
- Program to find sum of elements in a given array
- Find the first, second and third minimum elements in an array
- Find the average of first N natural numbers
- Find the minimum and maximum sum of N-1 elements of the array
- Minimum value to be assigned to the elements so that sum becomes greater than initial sum
- Find the Next perfect square greater than a given number
- Find the XOR of first half and second half elements of an array
- Count of array elements which is smaller than both its adjacent elements
- Replace array elements by sum of next two consecutive elements
- Maximize Array sum by swapping at most K elements with another array
- Divide every element of one array by other array elements
- Sum of array elements using recursion
- Sum of all elements in an array between zeros
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.