fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int fibo(int b,int a=0){
  5. int x=0;
  6. int y=1;
  7.  
  8. while(x<=b)
  9. {
  10. int z=x+y;
  11. int x0=x;
  12. x=y;
  13. y=z;
  14. if(x>a && x<b)
  15. {
  16. cout << x << " ";
  17. }
  18. }
  19. }
  20.  
  21. int main()
  22. {
  23. fibo(100);
  24. return 0;
  25. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
1 1 2 3 5 8 13 21 34 55 89