Wednesday, 18 December 2013

Fibonacci Series up to 1 to 100 Using c++


#include<iostream.h>
#include<conio.h>
void main()
{
  int  n,i,fst=0,sec=1;
  cout<<" Fibonacci  Series up to 1 to 100";
  for(i=0;i<=100;i++)
  {
  if(i<=1)
  {
    n=i;
  }
  else
  {
    n= fst+sec;
   fst=sec;
   sec=n;
  }
Cout<<”\t”<<n;
}
  getch();
}

1 comment: