/* Displaying Fibonacci series up to certain number entered by user. */

#include <stdio.h>
int main()
{
 
  int t1=0, t2=1, display=0, num;

  printf("Enter the limit for the Fibonacci series:\n ");
 
  scanf("%d",&num);
  
  
  printf("\nFibonacci Series: %d %d ", t1, t2); /* Displaying first two terms */
  
  display=t1+t2;
 
  while(display<num)
  {
      printf("%d ",display);
      t1=t2;
      t2=display;
      display=t1+t2;
  }
  
/*  int i;
  
  for (i=1; display<num; i++)
  
   {
      printf("%d ",display);
      t1=t2;
      t2=display;
      display=t1+t2;
  }
 */
  
  return 0;
}

