Probability that a N digit number is palindrome | Java code of above approach ; Find the probability that a n digit number is palindrome ; Denominator ; Assign 10 ^ ( floor ( n / 2 ) ) to denominator ; Display the answer ; Driver code
import java . util . * ; class GFG { static void solve ( int n ) { int n_2 = n / 2 ; String den ; den = "1" ; while ( n_2 -- > 0 ) den += '0' ; System . out . println ( 1 + " / " + den ) ; } public static void main ( String [ ] args ) { int N = 5 ; solve ( N ) ; } }