Advertisement
rony-Rony_05

problem 8

Jun 21st, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int num,first=0,secound=1,count=0,fibo;
  5. scanf("%d",&num);
  6. while(count<num)
  7. {
  8. if(count<=1){
  9. fibo=count;
  10. }
  11. else
  12. {
  13. fibo= first + secound;
  14. first= secound;
  15. secound= fibo;
  16. }
  17. printf("%d ", fibo);
  18. count++;
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement