
- 2 100 Pts Write A C Program E2p2 C That Accepts Three Command Line Arguments N M N Where N Is An Integer Between 2 An 1 (147.8 KiB) Viewed 29 times

- 2 100 Pts Write A C Program E2p2 C That Accepts Three Command Line Arguments N M N Where N Is An Integer Between 2 An 2 (31.43 KiB) Viewed 29 times
2. (100 pts) Write a C program E2p2.c that accepts three command line arguments n,M,N where n is an integer between 2 and 4 inclusive, M is an integral multiple of 24 (e.g. 24, 48, etc), and N is an integer between 5 and 15 inclusive. Generate M*N random integers between 1 and 79 inclusive and store them in an M by N 2D dynamic integer array. The program should use pthread to create n threads to backward-reverse-copy all the array elements in place (i.e. the first row and last row are swapped in reverse column order, the second row and second-to-last row are swapped in reverse column order, etc). The program should divide this task of backward-reverse-copying the array elements among the created in threads as evenly as possible. The program should print all the array elements before and after the update. A sample run can look like the following: [kwang@computer] [~/temp]$./E2p2 4 24 6 Using 4 threads. Original array: 48,78,14,76,76,50 34,21,54,64,62,47 ...(additional 20 rows here!!!!!!!!) 56,41,17,25,4,54 26,4,56,13,53,28
Backward-reverse-copy of the original array: 28,53,13,56,4,26 54,4,25,17,41,56 ...(additional 20 rows here!!!!!!!) 47,62,64,54,21,34 50,76,76,14,78,48