palindrome of number
import java.util.*;
class palendrome{
public static void main(String[] args) {
int n,rev=0;
System.out.println("enter the number");
Scanner s =new Scanner(System.in);
n=s.nextInt();
while(n!=0){
int k=n%10;
rev=rev*10+k;
n=n/10;
}
System.out.println("plinndrome is "+rev);
}
}
Comments
Post a Comment