Question: In C language programming. 16. Write a program that takes a list of integers and creates two new threads --- one thread counts the number

 In C language programming. 16. Write a program that takes a

In C language programming.

16. Write a program that takes a list of integers and creates two new threads --- one thread counts the number of integers in the list that are greater than 100; one thread takes the difference between the largest and the smallest integer in the list. The integers will be passed to the program on the command line. For example, assume your program executable is named calc and you run the program with the list of integers on the command line as shown below: $ calc 10 17 30 200 125 2 The program will output: The number of integers greater than 100 is 2. The difference between largest and smallest integer is 198. Declare global variables for storing the count of integers greater than 100 and for the difference between largest and smallest integer. The threads will set these values, and the parent thread will print these to screen after the child threads have finished

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!