Check if a number can be represented as product of two positive perfect cubes | C ++ 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
#include <bits/stdc++.h> NEW_LINE using namespace std ; void productOfTwoPerfectCubes ( int N ) { int cube_root ; cube_root = round ( cbrt ( N ) ) ; if ( cube_root * cube_root * cube_root == N ) { cout << " Yes " ; return ; } else { cout << " No " ; return ; } } int main ( ) { int N = 216 ; productOfTwoPerfectCubes ( N ) ; return 0 ; }