Thursday, 24 November 2022

Number Reverse

public static void main(String[] args) {
int n=121;
int rev=0;
while(n!=0)
{
rev = rev*10+n%10;
n=n/10;
}
System.out.println(rev);
if(n==rev)
System.out.println("number is palindrome");
else
System.out.println("number is not palindrome");
}

--
With Warm REGARDS,

En. S. WANKHEDE

No comments:

Post a Comment

Welcome, happy learning

Charactor_At_Position

public class Char_At_Position { public static void main(String[] args) { String str = "Wankhede"; String rev=""...