Check if a number can be represented as product of two positive perfect cubes | Java program for the above approach ; Function to check if the number N can be represented as the product of two perfect cubes or not ; If cube of cube_root is N ; Otherwise , print No ; Driver Code
import java . lang . * ; class GFG { public static void productOfTwoPerfectCubes ( double N ) { double cube_root ; cube_root = Math . round ( Math . cbrt ( N ) ) ; if ( cube_root * cube_root * cube_root == N ) { System . out . println ( " Yes " ) ; return ; } else { System . out . println ( " No " ) ; return ; } } public static void main ( String args [ ] ) { double N = 216 ; productOfTwoPerfectCubes ( N ) ; } }