Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int num, num1 = 0, num2 = 1, next;
- cin >> num;
- for (int i = 0; i < num; i++)
- {
- cout << num1 << endl;
- next = num1 + num2;
- num1 = num2;
- num2 = next;
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement