Logarithm tricks for Competitive Programming | C # implementation to find Kth root of the number ; Function to find the Kth root of the number ; Driver Code
using System ; class GFG { static double kthRoot ( double n , int k ) { return Math . Pow ( k , ( 1.0 / k ) * ( Math . Log ( n ) / Math . Log ( k ) ) ) ; } public static void Main ( ) { double N = 8.0 ; int K = 3 ; Console . Write ( kthRoot ( N , K ) ) ; } }