Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n, f=0, s=1, t;
- cout << "Enter the Number of Terms : ";
- cin >> n;
- cout << f << endl;
- cout << s << endl;
- for(int i=2; i<n; i++){
- t = f + s;
- cout << t << endl;
- f = s;
- s = t;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement