18 november coding question

 Palindrome  number--


System.out.println("enter the number :");
int n=sc.nextInt();

int t=n;
int s=0;
while(t>0){
int r=t%10;
s=s*10+r;
t=t/10;
}
if(s==n){
System.out.println("it is palindrome !");
}else {
System.out.println("no");
}

Comments

Popular Posts