Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- unsigned long long f1=1, f2=1, term, n, i;
- cout<<"n="; cin>>n;
- cout<<f1<<" "<<f2<<" ";
- for(i=3; i<=n; i++)
- {
- term=f1+f2;
- cout<<term<<" ";
- f1=f2;
- f2=term;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment