Advertisement
MeehoweCK

Untitled

Nov 5th, 2020
1,680
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int n;
  7.     unsigned long long a=1, b=0, c;
  8.     cout<<"how many numbers do you want to print?";
  9.     cin>>n;
  10.     cout<<a<<"\t";
  11.     for(int i = 1; i < n; ++i)
  12.     {
  13.         c=b;
  14.         b=a;
  15.         a=b+c;
  16.         cout<<a<<"\t";
  17.     }
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement