Home > Back-end >  C language for a certain range of Fibonacci number
C language for a certain range of Fibonacci number

Time:09-27

A given integer a, b, and the a CodePudding user response:

Ask ab range is how many a Fibonacci number, which is not to come out a few Numbers

CodePudding user response:

Write a recursive function using the count record the serial number

CodePudding user response:

Write a while (1), until the number is greater than b stops, and then within the loop with variable would
 
Int count=0;
Int a, b, c, d;
C=0;
cin> & gt; a> & gt; b;
While (1) {
If (c> B) break;
D=c;
C=a + c;
A=d.
count++;
}
cout<& lt;" There are "& lt; <(count - 1) & lt; & lt;" A ";

That should be what he did, are hand, playing is likely to go wrong
  • Related