C++:Program to print Fibonacci Series upto 100

1. #include<iostream>
2. using namespace std;
3. int main()
4. {
5. int temp=0,sum=0,f=0,s;
6. for(s=1;s<100;){
7. temp=s;
9. s=s+f;
10.f=temp;
11.cout<<s<<" ";
12. return 0;
13.}

_________________________________________
If you are using turbo C++.You have to write
#include<iostream.h>
#include<conio.h>
getch(); instead of return 0;
and don't write using namespace std;
               < Happy Coding >
In Association with Amazon.in

Popular Posts

Top 10 Web Sites Every Programmer Should Visit Daily

What is "namespace" and why do we use it?