text: Perfect cube greater than a given number | C ++ implementation of above approach ; Function to find the next perfect cube ; Driver Code
code: #include <cmath> NEW_LINE #include <iostream> NEW_LINE using namespace std ; int nextPerfectCube ( int N ) { int nextN = floor ( cbrt ( N ) ) + 1 ; return nextN * nextN * nextN ; } int main ( ) { int n = 35 ; cout << nextPerfectCube ( n ) ; return 0 ; }