On Tue, 01 Apr 2008 23:16:49 GMT, "Benjamin Rushing"
who said :
>I've been tasked with writing a simple java program where the user inputs a
>5 digit number and the program states whether it's a palindrome or not.
>I can't use an array or use the 'reverse' function of code. Anybody willing
>to give me a hint on how to procede?
Slacker's solution:
Reading the number as a string is no problem. It is extra work to read
it as an int.
See http://mindprod.com/applet/fileio.html
reverse the string. Compare.
To reverse the string without using reverse, cheat, and see how
reverse does it by looking at the code in source.zip
But the point is to LEARN java, not create a palindrome detector, so
this is a stupid solution.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com