Largest N digit number in Base B | Function to print the largest N - digit numbers of base b ; Find the largest N digit number in base b using the formula B ^ N - 1 ; Print the largest number ; Given Number and Base ; Function Call
function findNumbers ( n , b ) { let largest = Math . pow ( b , n ) - 1 ; document . write ( largest ) ; } let N = 2 , B = 5 ; findNumbers ( N , B ) ;