Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- long int y,n;char in;
- bool state=true;
- int main()
- {
- while(state){
- long int x=1,y,i,j,k;
- long int a=0,b=1,c;
- cout<<" n = ";
- cin>>y;
- cout<<a;
- for(i=0; i<=y-1; i++){
- c=a+b; b=a; a=c;
- if(i>=x-1)
- {
- cout<<" ";
- cout<<" "<<c;
- cout<<" ";
- }
- }
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement