BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan

BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan (http://bzupages.com/)
-   Data Structure (http://bzupages.com/32-data-structure/)
-   -   [Assignment] Recursive Function for Fibonacci Numbers in C (http://bzupages.com/f32/%5Bassignment%5D-recursive-function-fibonacci-numbers-c-948/)

BSIT07-01 06-10-2008 10:09 PM

[Assignment] Recursive Function for Fibonacci Numbers in C
 
Just copied from BOOK :)
Code:

int fib(int n)
{
    int x , y;
    if(n<=1)
    return(n);

    x=fib(n-1);
    y=fib(n-2);
    return(x+y);
}


BSIT07-01 06-10-2008 10:13 PM

Re: [Assignment] Recursive Function for Fibonacci Numbers in C
 
1 Attachment(s)
What is Fobonacci Series

The first number of the sequence is 0, the second number is 1, and each subsequent number is equal to the sum of the previous two numbers of the sequence itself, yielding the sequence 0, 1, 1, 2, 3, 5, 8, etc. In mathematical terms, it is defined by the following recurrence relation:

Sheraz 06-10-2008 11:13 PM

Re: [Assignment] Recursive Function for Fibonacci Numbers in C
 
ASSALAM_O_ALAIKUM

THANX YARA, THANK YOU VERY MUCH...........:flowers:

"MEIN AIEWEIN TAY NAHI TERAY UTTAY MARDA WAYYY":sobstory:

MERI JAAN KAL AGAR EASILY POSSIBLE HO TO DATA STRUCTURES KI BOOK LETAY AANA.....
LOVE YOU.:awub:
$$:23n:


All times are GMT +5. The time now is 07:27 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.