DEV Community

hema latha
hema latha

Posted on

Palindrome - program

package day1;

public class Palindrome {

public static void main(String[] args) {
    // TODO Auto-generated method stub
    int no = 191;
    int no2=no;

    int reverse = 0;
     while(no>0)
    {
    reverse = reverse*10 + no%10;              no=no/10;                                
    }
    System.out.println(reverse); 
if(reverse==no2)
    System.out.println("palindram");
else
    System.out.println("not palindram"); 


    }}

out put == 191  palindram
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more