Click Here To Follow our Telegram Channel for more such news and amazing free stuffs.
Telegram Channel - https://t.me/codexelltech
import java.util.Scanner;
public class Palindrome
{
public static void main(String[] args)
{
System.out.println("Enter a number : ");
int num = new Scanner(System.in).nextInt();
int number=num;
int rev=0;
while (number != 0)
{
int rem = number % 10;
rev = rev * 10 + rem;
number = number / 10;
}
if(num == rev)
System.out.println("it is a Palindrome number");
else
System.out.println("it is Not a Palindrome number");
}
}
Output:
Enter a number:
121
It is a Palindrome number.
Click Here To Follow our Telegram Channel for more such news and amazing free stuffs.
Telegram Channel - https://t.me/codexelltech
Click here to visit www.codexell.tech for more such references.
Telegram Channel - https://t.me/codexelltech
import java.util.Scanner;
public class Palindrome
{
public static void main(String[] args)
{
System.out.println("Enter a number : ");
int num = new Scanner(System.in).nextInt();
int number=num;
int rev=0;
while (number != 0)
{
int rem = number % 10;
rev = rev * 10 + rem;
number = number / 10;
}
if(num == rev)
System.out.println("it is a Palindrome number");
else
System.out.println("it is Not a Palindrome number");
}
}
Output:
Enter a number:
121
It is a Palindrome number.
Click Here To Follow our Telegram Channel for more such news and amazing free stuffs.
Telegram Channel - https://t.me/codexelltech
Click here to visit www.codexell.tech for more such references.