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 download and install eclipse on windows 10?
What is aop in java?
What is reflection in java?
How do javabeans work?
What is a java singleton?
Why bean class is used in java?
I want to control database connections in my program and want that only one thread should be able to make database connection at a time. Define how can I implement this logic?
What is tight coupling in java?
What is data encapsulation?
What is the purpose of jdk?
Why do we only use the main method to start a program?
How can you work with permissions from your .net application? : java security
Write a program for the following topic - switch case,looping using fuction calling,nesting,console input output. Aim- to print a menu:- 1-series 2-single value. Each menu having sub menu armstrong or perfect.
Who created eclipse?
How do I install java on windows?