GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Placement Papers  >  Aztec Systems  >  C

 Print  |  
Question:  Write a program to implement the Fibonacci series



October 10, 2008 03:14:30 #2
 memo132006   Member Since: October 2008    Total Comments: 1 

RE: Write a program to implement the Fibonacci series
 

#include <iostream>

using namespace std;

void main()

{

int limit,sum=0,i=1,j;cout<<"please enter the limit of the series ";

cin>>limit;

while(sum<=limit)

{

cout<<sum<<endl;

j=sum;

sum+=i;

i=j;

}

}

     

 

Back To Question