I need to to write a Java code that checks whether the user inputed number is in the Fibonacci sequence.
I have no issue writing the Fibonacci sequence to output, b
If my Java is not too rusty...
static bool isFib(int x) { int a=0; int b=1; int f=1; while (b < x){ f = a + b; a = b; b = f; } return x == f; }