Find Cube root of a number using Log function | C # program to find cube root of a number using logarithm ; Function to find the cube root ; Calculate the cube root ; Return the readonly answer ; Driver code
using System ; class GFG { static double cubeRoot ( double n ) { double ans = Math . Pow ( 3 , ( ( 1.0 / 3 ) * ( Math . Log ( n ) / Math . Log ( 3 ) ) ) ) ; return ans ; } public static void Main ( String [ ] args ) { double N = 8 ; Console . Write ( " { 0 : F2 } " , cubeRoot ( N ) ) ; } }