Java Homework Assignment?
How do you write a program in Java that prints all of the integers between 10000 and 16000 that are the same number when the digits in the number are reversed?
- llafferLv 71 month agoFavorite Answer
1) Create a loop that hits every integer between the two values
2) For each iteration in the loop, have a routine that checks of the number is a palindrome
3) if it is, output the number. If it isn't, do nothing and end the loop.
- EddieJLv 71 month ago
Well, you start by determining if ONE number is the same when reversed.
You have to decide if you are to do it mathematically or if you want to convert the integer to a string and see if it's a palindrome. Have you already dealt with palindromes?