fibonacci Numbers

kahhan at bnr.ca kahhan at bnr.ca
Mon Apr 15 21:24:58 AEST 1991


In article <1991Apr12.051844.15063 at milton.u.washington.edu> amigo at milton.u.washington.edu (The Friend) writes:
>
>     Can someone send me source code for a routine to calculate 
>Fibonacci numbers to _x_ (x being input from user)? Additionally it'd
>be great if this found the PRIME numbers in the set. It could print its
>results as it went through (if that makes it any easier).
>

Why not just use the equation and calculate the nth number directly? Then
you could just embed the equation in a loop (for i=1 to n) and you'll
have what you want.

-- 
--------------------------------------------------------------------------------
Larry Kahhan - NRA, NRA-ILA, CSG, GOA, GSSA |   The opinions expressed here do
               lkahhan at bnr.ca               |   not necessarily represent the
                                            |   views of the management.
--------------------------------------------------------------------------------



More information about the Comp.lang.c mailing list