Saturday, January 25, 2020

Posted on Leave a Comment

Fibonacci series source code in C

Fibonacci series

Source code


#include

#include

void main() {
  int a, b, c, num, i;
  a = 0, b = 1, c = 0;
  clrscr();
  printf(“\nEnter the number till which u want the series::”);
  scanf(“ % d”, & num);
  printf(“\n”);

  for (i = 0; i < num; i++, c = a + b) {
    a = b;
    b = c;
    printf(“ % d\ t”, c);
  }
  getch();
}

0 comments:

Post a Comment

Codearea.in is featured by projectsgeek.com. Powered by Blogger.