fibonacci.frink

View or download fibonacci.frink in plain text format


// Function to generate the nth item of the Fibonacci sequence.
fibonacciN[n] :=
{
   a = 0
   b = 1
   count = 0
   while count<n
   {
      [a,b] = [b, a + b]
      count = count + 1
   }
   return a
}


View or download fibonacci.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 17646 days, 9 hours, 34 minutes ago.