Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started