Question: Write a C program that initializes a global array of ten integers called numbers. Declare another global array of ten integers called factorials. Your main

Write a C program that initializes a global array of ten integers called "numbers". Declare another global array of ten integers called "factorials". Your main program should create ten threads and pass one index (say i, between 0-9) to each child thread. The child thread computes the factorial of "numbers[i]" and stores the factorial
in "factorials[i]". Thus:
thread 0 computes the factorial of numbers[0] and stores the answer in factorials[0]
thread 1 computes the factorial of numbers[1] and stores the answer in factorials[1]
...
thread 9 computes the factorial of numbers[9] and stores the answer in factorials[9].
After all threads have finished computations, the main program should display each number in "numbers" and the corresponding factorial in "factorials".

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!