I was messing around with the fibonacci sequence and it's implementation and I got the hang of it.
And I want to find which number from the fibonacci sequence is bigger than the one given but the problem is if it's a fibonacci number there's a logical error
You have no branch for == in which_fib, so it drops through and returns garbage (your compiler should warn you about that possibility).
So the first test needs to be <=, and the second should just be an else.
If the compiler didn't warn you then you need to turn up the warning level. In gcc and clang you can add the -Wall flag (as well as the -Wextra and -pedantic flags). Look up how to do it for other compilers. The warnings are really helpful.