Open and read a file of integers into an array that is created with the first integer telling you how many to read.
So 4 9 11 12 15 would mean create an int array size 4 and read in the remaining 4 values into data[].
Then compute their average as a double and their max as an int. Print all this out neatly to the screen and to an output file named.
PLEASE HELP ME FORM THE PROGRAM PLEASE AND ANSWER IN THE PROGRAM LANGUAGE PLEASE
Answers
Answered by
2
Answer:
Input : 5, 4, 6, 9, 10 Output : 9 10 Explanation: avg = 5 + 4 + 6 + 9 + 10 / 5; avg = 34 ... Recommended: Please try your approach on {IDE} first, before moving on to the solution. ... Print array elements greater than average ... double avg = 0;. for ( int i = 0; i < n; i++) ...
Similar questions