Time | Java program to find Nth Fibonacci number using recursion ; Function to find Nth Fibonacci term ; Base Case ; Recursively computing the term using recurrence relation ; Driver Code ; Function Call
class GFG { static int Fibonacci ( int N ) { if ( N < 2 ) return N ; return Fibonacci ( N - 1 ) + Fibonacci ( N - 2 ) ; } public static void main ( String [ ] args ) { int N = 5 ; System . out . print ( Fibonacci ( N ) ) ; } }