text: Perfect cube greater than a given number | C # implementation of above approach ; Function to find the next perfect cube ; Driver Code
code: using System ; class GFG { static int nextPerfectCube ( int N ) { int nextN = ( int ) Math . Floor ( Math . Pow ( N , ( double ) 1 / 3 ) ) + 1 ; return nextN * nextN * nextN ; } public static void Main ( ) { int n = 35 ; Console . Write ( nextPerfectCube ( n ) ) ; } }