Question: Review the following code fragment which creates a thread to compute 10 factorial (10 x 9 x 8 ... x 1): int fact = 1;

Review the following code fragment which creates a thread to compute 10 factorial (10 x 9 x 8 ... x 1): int fact = 1; void *mul(void *param); int main() { pthread_t tid; pthread_attr_t attr; int n = 10; pthread_attr_init(&attr); pthread_create(&tid, &attr, mul, &n); pthread_join(tid, NULL); printf("%d factorial = %d ", n, fact); } void *mul(void *param) { // TO DO: Your code here pthread_exit(0); }

Need some help completing the mul function please using C language

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!