How do you write a palindrome ?

How to write a numerical palindrome without using array and string?
[74 byte] By [draughtecha] at [2007-10-3 5:20:01]
# 1
DallasSallad
Martin@Stricenta at 2007-7-14 23:26:58 > top of Java-index,Java Essentials,Java Programming...
# 2
No, she wants numerical palindromes.101 is a good one. As in Java 101. As in the class this is for.
hunter9000a at 2007-7-14 23:26:58 > top of Java-index,Java Essentials,Java Programming...
# 3
I have always been fond of 666.
Martin@Stricenta at 2007-7-14 23:26:58 > top of Java-index,Java Essentials,Java Programming...
# 4
Here is a palindrome (though not numeric) that the OP should study:Would you like fries with that taht htiw seirf ekil uoy dluoW
warnerjaa at 2007-7-14 23:26:58 > top of Java-index,Java Essentials,Java Programming...
# 5

But seriously though, if you want to get help here, you need to show a lot more initiative than just asking a question. How do you expect us to put effort into solving your problem if you don't? Show us what you have tried, and please use the code tags. Tell us exactly what your problem is. If you don't know where to start, describe how you would do this on paper.

hunter9000a at 2007-7-14 23:26:58 > top of Java-index,Java Essentials,Java Programming...
# 6
Hm... if you have to avoid arrays, I'd use recursion.
Mongera at 2007-7-14 23:26:58 > top of Java-index,Java Essentials,Java Programming...
# 7
Google for "numerical palindrome", and you will find an algorithm to create a numerical palindrome starting from almost any given number (it works for most starting numbers).
doremifasollatidoa at 2007-7-14 23:26:58 > top of Java-index,Java Essentials,Java Programming...
# 8

uh, something quick

public int palindromize(int number)

{

int retnum = number;

while((number/10) !=0)

{

retnum = retnum * 10 + (number%10);

number = number/10;

}

retnum = retnum * 10 + number;

return retnum;

}

Message was edited by:

sophisticatedd

sophisticatedda at 2007-7-14 23:26:58 > top of Java-index,Java Essentials,Java Programming...