Question: Using JAVA, write a method numBackward that reverses the digits of a given integer (that is, an integer passed in as an argument). Use a
Using JAVA, write a method numBackward that reverses the digits of a given integer (that is, an integer passed in as an argument). Use a single loop and modular arithmetic to accomplish this goal. After you reverse the digits, compare the number you got with the original argument and determine if the original argument is a palindrome. Your method should print a message to the screen that states the reversed number and whether or not it is a palindrome. For example: numBackward(123456789) //should print: "backward: 987654321, not palindrome!" numBackward(123454321) //should print: "backward: 123454321, palindrome!"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
