SHARE
TWEET

Untitled

a guest Jun 27th, 2017 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Class Palindrome
  2. {
  3.     public static void main(String args[])
  4.     {
  5.         String s=" (insert palindrome here) ";
  6.         int i;
  7.         int n=s.length();
  8.         String str="";
  9.  
  10.         for(i=n-1;i>=0;i--)
  11.             str=str+s.charAt(i);
  12.  
  13.         if(str.equals(s))
  14.             System.out.println(s+ "is palindrome");
  15.         else
  16.             System.out.println(s+ "is not a palindrome");
  17.     }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top