Find the Largest N digit perfect square number in Base B | C # implementation to find largest N digit perfect square number in base B ; Function to find the largest N digit number ; Largest n - digit perfect square ; Print the result ; Driver code
using System ; class GFG { static double nDigitPerfectSquares ( int n , int b ) { double largest = Math . Pow ( Math . Ceiling ( Math . Sqrt ( Math . Pow ( b , n ) ) ) - 1 , 2 ) ; return largest ; } public static void Main ( String [ ] args ) { int N = 1 , B = 8 ; Console . WriteLine ( nDigitPerfectSquares ( N , B ) ) ; } }