0

can anyone help me?

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.

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by DangerDev
0

FYI, this type of post is a good way to be ignored:

can you help me?

<complete text of a homework assignment>

It suggests that by "can you help me?", you really mean "can you do it for me?". We're not a homework service, so prove that you've engaged your brain or you're not getting any help.

0

first try something from your side, if you are getting error put your code here, we will try to do some thing.
No one here would like to spoon feed any one.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.