Generating Fibonacci Series using Recursion: C Program

preview_player
Показать описание

Write a recursive function to obtain the first 25 numbers of a Fibonacci sequence. In a Fibonacci sequence the sum of two successive terms gives the third term. Following are the first few terms of the Fibonacci sequence:

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 ...

Note: In this video tutorial we've taken 0 and 1 as the first 2 numbers in the Fibonacci series- they're called Seed Values. And we ask the user to enter the limit or the number of terms to be printed in the Fibonacci Series.

At the end of above mentioned article you can find C program source code which exactly matches the above problem statement. So if you're only looking for exact solution to above problem statement, then directly visit the link present above and scroll to the end of the article and you can get the source code for it.

C Programming Interview / Viva Q&A List

C Programming: Beginner To Advance To Expert
Рекомендации по теме
Комментарии
Автор

Great one! I've searched several algorithms but none of them is this neat!

imnuwzw
Автор

Thanks man. Im currently studying c language and your channel have been so much useful. 🤗🤗🤗

rohitraushan
Автор

Ok so I was really bin puzzle when reaching Fibbo(5), so it was when we did Fibbo(5-1) we got Fibbo(4) which became calling function of Fibbo(4-1) and Fibbo(4-2) which gave (1+1) and then we went back to our function call Fibbo(5) to do then next operation of Fibbo(5-2) which was 3 and returned 1, therefore we got 3.
Thank you for simple explanation

Sake