Smallest and Largest Palindrome with N Digits | Function to print the smallest and largest palindrome with N digits ; Driver Code
function printPalindrome ( n ) { if ( n == 1 ) { document . write ( " " ) ; document . write ( " " ) ; } else { document . write ( " " + ( parseInt ( Math . pow ( 10 , n - 1 ) ) + 1 ) ) ; document . write ( " " + parseInt ( Math . pow ( 10 , n ) - 1 ) ) ; } } var n = 4 ; printPalindrome ( n ) ;