Palindrome

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.

Find the largest palindrome made from the product of two 3-digit numbers.


Try other problems Here


The answer is 906609.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public class Main {
    public static int pallindrome(int n) {
        int r, temp = n, sum = 0;
        while (n > 0) {
            r = n % 10;
            sum = sum * 10 + r;
            n = n / 10;
        }
        if (temp == sum) {
            return temp;
        } else {
            return 0;
        }
    }
    public static void main(String[] args) {
        int i, j, no, temp = 0;
        for (i = 100; i < 1000; i++) {
            for (j = 100; j < 1000; j++) {
                no = i * j;
                if (temp < pallindrome(no)) {
                    temp = pallindrome(no);
                }
            }
        }
        System.out.println(temp);
    }
}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...