₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,346,145 members, 8,521,394 topics. Date: Thursday, 19 November 2026 at 10:50 AM

Toggle theme

Pascal Subprogram Of Fibonacci Series Using Function - Programming - Nairaland

Nairaland Forum › Science/Technology › Programming › Pascal Subprogram Of Fibonacci Series Using Function (1859 Views)

1 Reply (Go Down)

Pascal Subprogram Of Fibonacci Series Using Function by Graciia(op): 4:21am On Aug 03, 2014
http://detutor8..com/2014/04/pascal-subprogram-of-fibonacci-series.html?m=1


The Fibonacci series is one in which the addition of two previous terms gives you the next term. That is. 0,1,2,3,5,8,13....1 + 2 is the next consecutive term which is 3, so is 3 + 5 (coolthe next term.

This program uses a function subprogram to call by value.

Program Fibnacci;
Var
I : integer;
Function fibonacci (a: integer): integer;
Begin
If a=1 then
   Fibonacci :=0
Else if n=2 then
    Fibonacci :=1
Else
    Fibonacci := Fibonacci(a-1) + Fibonacci (n-2);
End;
Begin
For I:= 1 to 20 do
Writeln(Fibonacci (I));
Readln
End.
Re: Pascal Subprogram Of Fibonacci Series Using Function by Sundayademola(m): 3:06pm On Aug 03, 2014
Who is this for exactly?
Re: Pascal Subprogram Of Fibonacci Series Using Function by Graciia(op): 10:35pm On Aug 04, 2014
Whoever actually needs it
Re: Pascal Subprogram Of Fibonacci Series Using Function by asalimpo(m): 11:20pm On Aug 04, 2014
Go to d thread "I want to Learn programming ... " and rewrite ur program in one of d languages suggested there in d responses.
Then,ur program wud b more useful.
1 Reply

Pascal Program For Matrix Multiplication • Algorithm For Pascal Program • Without Using Pow Function In C • 2 • 3 • 4

Top 10 Popular Blogger In Nigeria • Tchat (a Scaled Down Java Version Of Yahoo Messenger For Nigeria.) • Help On Project And Seminar Topics!