Logarithm | C # program to find log ( n ) using Recursion ; Driver Code
using System ; class GFG { static int Log2n ( int n ) { return ( n > 1 ) ? 1 + Log2n ( n / 2 ) : 0 ; } public static void Main ( ) { int n = 32 ; Console . Write ( Log2n ( n ) ) ; } }