Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main (void)
- {
- int r=0,a=0,n,b=1,i;
- char redo;
- do
- {
- a=0;
- b=1;
- cout<<"enter the the value of n:";
- cin>> n;
- if(n>100){
- cout<<"enter some lessor value"<<endl;
- }
- else{
- cout<<a<<endl;
- for (i=0;i>=n;i++)
- {
- c=a+b;
- a=b;
- b=c;
- cout<<"serial no."i+1<<"==";
- cout<<a <<endl;
- }
- cout<<"enter y or Y to continue:";
- cin>>redo;
- cout<<endl<<endl;
- }
- }
- while(redo=='y'||redo=='Y');
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement