write a program to print the highest palindrome value that is the multiplication of two numbers lies between 100 to 1000.
csk19
0
Newbie Poster
Recommended Answers
Jump to PostWe won't just do your homework for you. Please show us what you've tried yourself, and where you're stuck.
Jump to PostPart1: see bguild's answer.
Part2: If you start by finding palindromes then you are left with the problem of finding out if each palindrome is the product of of two numbers 100-999 (not so easy).
If you start by multiplying every possible combination of two numbers 100-999. that's only 500,000 …
Jump to PostSystem.nanoTime() returns the time in nanoSeconds. Take its value before you start and after you finish and subtract the two.
Jump to PostBelow is my result (forgot to add). Not very fast though :P
Mininum:100 | Maximum:1000
Found at 993 x 913 = 906609
Total time: 16 millisecond(s)
Mininum:100 | Maximum:10000
Found at 9999 x 9901 = 99000099
Total time: 6 millisecond(s)
Mininum:100 | Maximum:100000
Found at 99979 x 99681 = …
All 15 Replies
Dani
4,084
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member
csk19
0
Newbie Poster
bguild
163
Posting Whiz
csk19
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
TrustyTony
888
pyMod
Team Colleague
Featured Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
TrustyTony
888
pyMod
Team Colleague
Featured Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
csk19
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Taywin
312
Posting Virtuoso
csk19
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
csk19
commented:
the program takes takes 23ms.
+0
Taywin
312
Posting Virtuoso
csk19
commented:
very impressive.!
+0
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.