Fibonacci Series

//Fibonacii series.

#include<stdio.h>
main()
{
 int i,first=0,second=1,range,next;
 printf("Enter the range of fibonacii series\n");
 scanf("%d",&range);
    printf("FIBONACII SERIES : %d %d ",first,second);
 for(i=2;i<range;i++) 
 {
  next=first+second;
  first=second;
  second=next;
  printf("%d ",next);
 }
} 

No comments:

Post a Comment