Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int a=0,b=1,n,i,fibo,count=0;
- scanf("%d",&n);
- while(count<n)
- {
- if(count==0)
- printf("%d",count);
- if(count==1)
- printf(" %d",count);
- if(count>=2)
- {
- fibo=a+b;
- a=b;
- b=fibo;
- printf(" %d",fibo);
- }
- count++;
- }
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement