Skip to content

Instantly share code, notes, and snippets.

@Mohamed209
Created November 15, 2016 12:34
#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