Skip to content

Instantly share code, notes, and snippets.

@wohhie
Created July 21, 2016 05:57
Show Gist options
  • Save wohhie/a4bb50a0ff0a13a1296f252fd5f68416 to your computer and use it in GitHub Desktop.
Save wohhie/a4bb50a0ff0a13a1296f252fd5f68416 to your computer and use it in GitHub Desktop.
Fibbonacci Series
#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