Created
January 18, 2019 18:36
-
-
Save sayantanHack/14cf507c69e8438a42d53199a5a4ffca to your computer and use it in GitHub Desktop.
This is the fibonacci series program , which print the series upto 15 numbers , you can increase or decrease variable n upto how many you choose to print . Happy coding !
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> | |
int main(void){ | |
int n=15,i,f1=0,f2=1, nextItem=0; // initializing the variables | |
for(i=0;i<n;i++){ | |
printf("%d ", f1); // printing variables | |
nextItem= f1+f2; // fibo algo | |
f1=f2; // exchanging the values | |
f2= nextItem; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment