Memoization ( 1D , 2D and 3D ) | C # program to find the Nth term of Fibonacci series ; Fibonacci Series using Recursion ; Base case ; recursive calls ; Driver Code
using System ; class GFG { static int fib ( int n ) { if ( n <= 1 ) return n ; return fib ( n - 1 ) + fib ( n - 2 ) ; } static public void Main ( ) { int n = 6 ; Console . WriteLine ( fib ( n ) ) ; } }