Options: Save as PDF | Save attached file | Toggle line numbers
The problem description is included with the code.
||May 25 2009 at 11:01 AM
Run the routine, the answer is printed in the debugging screen.
'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.
Dim i As Long, i2 As Long
Dim lPalindrome As Long
'Assume that palindrome is a 6 digit number
'(could be 5 digits but for now ignore that option)
lPalindrome = 0
For i = 999 To 316 Step -1
For i2 = i To 316 Step -1
If bPalindrome(i * i2) Then
If i * i2 > lPalindrome Then
lPalindrome = i * i2