I am writing a \"simple\" program to determine the Nth number in the Fibonacci sequence. Ex: the 7th number in the sequence is: 13. I have finished writing the program, it
It looks better with multiple statements of ternary operator.
static int fib(int n) { return n > 5 ? fib(n-2) + fib(n-1) : n < 2 || n == 5 ? n : n - 1; }