The problem description, from the Project Euler website:

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.

Again, a little brute force never hurt anybody 😛

## General Algorithm

Before you begin, you must identify how exactly your going to check if a number is a palindrome. The question defines a palindrome for you: *A palindromic number reads the same both ways*. IMO, the easiest way to check if a number is a palindrome is to *reverse it* and see if it is equal to it’s **original** value. Given below is a general reverse algorithm.

- Initialize reversed number to zero.
- While the number to be reversed (
*n*), is not zero:- Get the last digit by n % 10.
- Make it a subsequent digit of the reversed number by doing the following:
- Reversed number *= 10.
- Reversed Number += last digit.

- Remove the last digit (n /= 10).

- At the end of the loop, you will have the reversed number.

I guess the iteration for checking the product of every 3 digit number needs no explanation.

Note: If you’re having trouble with

on your compiler, replace it with**_int64**** long long int**

## himanshusahay23

/ January 15, 2012Project Euler seems suspiciously similar to the CBSE course, don’t you think? 😛

## virajmahesh

/ January 16, 2012Fibonacci numbers are the same, whether it’s cbse or Euler. And the problems become difficult later on.