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
Get step-by-step solutions from verified subject matter experts
