123456789101112131415161718192021 |
- #include "example.h"
- int
- fib(int n)
- {
- int i=0;
- if (n==1 || n==0) return 1;
- for(i=0;i<n;i++){
- return (fib(n-1) + fib(n-2));
- }
- return (-1);
- }
- void*
- runner1(void* arg)
- {
- struct fibo* fibl = (struct fibo*) arg;
- fibl->answer = fib(fibl->limit);
- pthread_exit(0);
- }
|