Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

palindrome find in java

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int num = input.nextInt();
        int temp = num;

        int rev = 0;
        while (num > 0) {
            rev = rev * 10 + num % 10;
            num /= 10;
        }
        System.out.println(temp==rev?"palindrome":"not palindrome");
    }
Source by workat.tech #
 
PREVIOUS NEXT
Tagged: #palindrome #find #java
ADD COMMENT
Topic
Name
3+5 =