# Write a program to find the largest palindrome made from the product of two 3-digit numbers. E.g The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Hint: A palindromic number reads the same both ways.

**Updated:**June 4, 2023 —

**Training Time:**1 Minute

Overseen by: Archangel Macsika

All Training Resources

Scroll for more menu list

**Topic:**Generic - Java Programming

**Difficulty:** Easy.

**Companies who previously asked this:** -.

**Objective:** Write a program to find the largest palindrome made from the product of two 3-digit numbers. E.g The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Hint: A palindromic number reads the same both ways.

**Input:** Two 3-digit number.

**Expected Output:** Result will vary depending on the user input.

### Sikademy Solution

```
package sikademy;
/**
*
* @author Archangel Macsika
*/
import java.util.logging.Level;
import java.util.logging.Logger;
// This class finds the largest palindrome of product of two 2-digit number
public class Palindrome {
private static final Logger LOG=Logger.getLogger(Palindrome.class.getName());
public static void main(String[] args) {
LOG.info("Entered Main function");
int value = 0;
for(int i = 100;i <= 999;i++)
{
for(int j = i;j <= 999;j++)
{
int value1 = i * j;
StringBuilder sb1 = new StringBuilder(String.valueOf(value1));
String sb2 = String.valueOf(value1);
sb1.reverse();
if(sb2.equals(sb1.toString()) && value < value1) {
value = value1;
}
}
}
System.out.println(value);
}
}
```