Smallest and Largest N | Function to print the largest and the smallest n - digit perfect cube ; Smallest n - digit perfect cube ; Largest n - digit perfect cube ; Driver code
< ? php function nDigitPerfectCubes ( $ n ) { print ( pow ( ceil ( pow ( pow ( 10 , ( $ n - 1 ) ) , 1 / 3 ) ) , 3 ) . " ▁ " ) ; print ( ( int ) pow ( ceil ( pow ( pow ( 10 , ( $ n ) ) , 1 / 3 ) ) - 1 , 3 ) ) ; } $ n = 3 ; nDigitPerfectCubes ( $ n ) ; ? >