We get total 90 numbers between 100 and 1000.
public class PalindromeNumber {
public static void main(String[] args) {
int n=121;
int rev=0;
int temp=n;
while(n!=0){
rev=rev*10+n%10;
n=n/10;
}
if(temp==rev){
System.out.println(temp+" Is Palindrome");
}else{
System.out.println(temp+" Is Not Palindrome");
}
}
}
0 comments:
Post a Comment