Created
July 21, 2016 05:57
-
-
Save wohhie/a4bb50a0ff0a13a1296f252fd5f68416 to your computer and use it in GitHub Desktop.
Fibbonacci Series
This file contains hidden or 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() { | |
int fib1 = 0, | |
fib2 = 1, | |
count = 2, | |
limit, | |
fib3; | |
printf("Fibboniaci Series:\n"); | |
printf("Enter limitation: "); | |
scanf("%d", &limit); | |
printf("\n"); | |
printf("%d", fib1); | |
printf(" "); | |
printf("%d", fib2); | |
while (count < limit) { | |
fib3 = fib1 + fib2; | |
printf(" %d", fib3); | |
count++; | |
fib1 = fib2; | |
fib2 = fib3; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment