Write functions to:

int isprime(int); /* Returns a true value if a is a prime number */

int nextFib(); /* Returns the next fibonacci value (use static variables to track which one was used last call) */

The fibonacci sequence is defined as:

Fib(0)=1

Fib(1)=1

Fib(2)=Fib(1)+Fib(0)

....

Fib(N)=Fib(N-1)+Fib(N-2)

Write a main program which will call nextFib 40 times and the check to see whether the each fibonacci number is prime using isprime.

Your program will then report the sequence number, the fibonacci value, and whether or not the number is prime.

This post has been edited by **ladiesman**: 19 February 2008 - 11:04 AM