text: Check if number formed by joining two Numbers is Perfect Cube | C # program to check if the concatenation of two numbers is a perfect cube or not ; Function to check if a number is a perfect Cube or not ; Function to check if concatenation of two numbers is a perfect cube or not ; Convert numbers to string using to_string ( ) ; Concatenate the numbers and convert it into integer ; Check if concatenated value is perfect cube or not ; Driver Code
code: using System ; class GFG { static bool isPerfectCube ( int x ) { double cr = Math . Round ( Math . Cbrt ( x ) ) ; return ( cr * cr * cr == x ) ; } static void checkCube ( int a , int b ) { string s1 = Convert . ToString ( a ) ; string s2 = Convert . ToString ( b ) ; int c = Convert . ToInt32 ( s1 + s2 ) ; if ( isPerfectCube ( c ) ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } public static void Main ( ) { int a = 6 ; int b = 4 ; checkCube ( a , b ) ; } }