Perfect Cube | Function to check if a number is a perfect Cube using inbuilt function ; If cube of cube_root is equals to N , then print Yes Else print No ; Driver 's code ; Function call to check N is cube or not
function perfectCube ( N ) { let cube_root ; cube_root = Math . round ( Math . cbrt ( N ) ) ; if ( ( cube_root * cube_root * cube_root ) == N ) { document . write ( " " ) ; return ; } else { document . write ( " " ) ; return ; } } let N = 125 ; perfectCube ( N ) ;