It is not a perpetual loop, it is only a long loop.
Maybe you don't want to write the number parameter on screen, so delete line 24 to obtain a clean result.
The output is kind of slow so it makes your program take much longer time to complete. Do you understand how many times the fibonacci function is actually being called? Calling fibonacci(35) will result in 29 860 703 calls to the function. Printing that many numbers is going to take a while.
It won't run continuously. All the additional IO simply slows it down.
The f(3) in my example executes line 24 for five times.
f(4) prints nine numbers.
f(5) prints 15 numbers.
...
Therefore, f(35) will print quite many numbers.