Largest and Smallest N | Function to return the largest N - digit number in Hexa - Decimal Number System ; Append ' F ' N times " a " . repeat ( 10 ) ; Function to return the smallest N - digit number in Hexa - Decimal Number System ; Append '0' ( N - 1 ) times to 1 ; Function to print the largest and smallest N - digit Hexa - Decimal number ; Driver code
function findLargest ( N ) { var largest = " " . repeat ( N ) ; return largest ; } function findSmallest ( N ) { var smallest = " " + " " . repeat ( N - 1 ) ; return smallest ; } function print ( largest ) { document . write ( " " + findLargest ( largest ) + " " ) ; document . write ( " " + findSmallest ( largest ) + " " ) ; } var N = 4 ; print ( N ) ;