Friday, May 21, 2010

Fibonacci numbers in c++ with fork in Unix/linux ?

i wanna write a c++ code in unix/linux that uses fork function to calculate the Fibonacci numbers. who can help me with the code ?

Fibonacci numbers in c++ with fork in Unix/linux ?
The Fibonacci sequence a(1), a(2), a(3), ..., a(n), ... is defined by





a(1) =1


a(2) = 1


a(n) = a(n-1) + a(n-2), for all n %26gt; 2


This generates the sequence





1, 1, 2, 3, 5, 8, 13, 21, ...





Write a C++ function "fibonacci(...)" that computes the Fibonacci number corresponding to its positive integer argument, so that, for example, fibonacci(7) == 13


This link will help http://gee.cs.oswego.edu/dl/papers/fj.pd...


No comments:

Post a Comment