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