Question: C- Write a program in C which takes 5 CLI arguments (A, B, C, D and E) and creates 25 POSIX threads. These threads each
C- Write a program in C which 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 count of these numbers and write them into files named nums0.txt, nums1.txt, etc. When these threads are done, main thread must print the results on 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
Get step-by-step solutions from verified subject matter experts
