Answer Posted / mahesh
import java.lang.*;
class Plindrome
{
public static void main(String arg[])
{
int n=121,m;
int rev,rem;
rev=0;m=n;
while(n>0)
{
rem=n%10;
rev=rev*10+rem;
n=n/10;
}
if(m==rev)
{
System.out.println("palindrome",+rev);
}
else
{
System.out.println("not palindrome",+rev);
}
}
}
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How do I open the java control panel?
Is java built on c?
What is ioexception in java?
Can we extract main method from another class?
Is java a framework?
Explain the common use of ejb?
What is jersey in java?
What is lambda expression in mvc?
Why oracle type 4 driver is named as oracle thin driver?
What does public static void main(string[]) mean?
What is the java api?
Write a class which checks whether a given number is prime or not. Write another class to implement the behavior of previous class and print the series of twin prime number upto a given range.
Which is better openjdk or oracle jdk?
What is a container in java?
What are jpa annotations?