Question: Write a program in C that takes 5 CLI arguments (A, B, C, D, and E) and creates 25 POSIX threads. These threads each are

Write a program in C that takes 5 CLI arguments (A, B, C, D, and E) and creates 25 POSIX threads. These threads each are responsible for generating E random integers between A and B. If any of these numbers are evenly divisible by C but not D, the program must keep a count of these numbers and write them into files named nums0.txt, nums1.txt, etc. When these threads are done, the main thread must print the results on the screen.

Sample Run $ ./program1 10 100 10 20 500

Thread 0 32 // file contents: 70 30 10 30 90 50 50 . . .

Thread 1 24 // file contents: 90 30 30 50 50 50 10 . . . . . .

Thread 23 - 34 // file contents: 70 10 10 10 50 90 90 . . .

Thread 24 22 // file contents: 50 70 90 30 50 90 50 . . .

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!