Write a program in C/C++/Linux to find the mean and then use that mean for
further calculations. Make three threads to perform different task as follows:
a) The 1st Thread will find the mean.
b) The 2nd Thread will take the mean from the 1st Thread and display the numbers
that are greater than the mean.
c) The 3rd Thread will also take the mean from the 1st Thread and display the
factorial of the two numbers that are the closest to the mean.
d) The Thread#2 and Thread#3 will wait until the thread#1 complete its task, and
then terminate by giving an appropriate message on the screen.
This program should take user input from command line as follows to calculate the mean:
Sample output is shown below:
[prompt]# ./file 12 7 11 14 5 7 9 4 33 65
Output starts here
Thread 1 starts
Mean = 16.7
Thread 1 ends
Thread 2 starts
Thread 2 ends
Thread 3 starts
Thread 3 ends
End of output