Write a program to input a number from the user and print whether it is a palindrome number or not as follows.
int palindrome(int p): To check and return whether the number is a palindrome number or not.(A number which is read same from both the sides is called palindrome number. E.g. 121, 454, 12321, 565…etc.) The function returns 1(one) if the number is palindrome otherwise returns 0(zero)
void main(): To input a number from the user and print whether it is a palindrome number or not using a returned type method called int palindrome(int n)
please help .it is in java
Answers
Answered by
1
Answer:
Here, the user is asked to enter an integer. The number is stored in variable n.
We then assigned this number to another variable orignal. Then, the reverse of n is found and stored in reversed.
If original is equal to reversed, the number entered by the user is a palindrome.
Similar questions