Created
November 15, 2016 12:34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <math.h> | |
#include <stdbool.h> | |
void fibonacci25(int start,int current) | |
{ | |
int next; | |
static int t=23; | |
if(t--) | |
{ | |
next=start+current; | |
start=current; | |
current=next; | |
printf("%d\n",next); | |
fibonacci25(start,current); | |
} | |
return; | |
} | |
int main() | |
{ | |
int start=0; int current=1; | |
printf("%d\n%d\n",start,current);//print first two terms 0,1 | |
fibonacci25(start,current);//function that print first 25 number of fibonacci series | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment