text: Exponential factorial of N | C # program for the above approach ; Function to find exponential factorial of a given number ; Stores the exponetial factor of N ; Iterare over the range [ 2 , N ] ; Update res ; Return res ; Driver Code ; Input ; Function call
code: using System ; class GFG { static int ExpoFactorial ( int N ) { int res = 1 ; int mod = 1000000007 ; for ( int i = 2 ; i < N + 1 ; i ++ ) res = ( int ) Math . Pow ( i , res ) % mod ; return res ; } public static void Main ( ) { int N = 4 ; Console . Write ( ExpoFactorial ( N ) ) ; } }