Skip to main content

Posts

Showing posts with the label string palindrome

String Palindrome

AJ Java Programs Program 8: String Palindrome: A String is said to be palindrome if  it conveys same meaning when read from front or back Example  MADAM, DAD, MALAYALAM etc Syntax: import java.io.*; class str_palin {     public static void main(String args[])throws IOException     {         BufferedReader br=new BufferedReader(new InputStreamReader(System.in));         String s,rev="";         System.out.println("Enter a string to reverse It");         s=br.readLine();         s.trim();         int l=s.length();         for(int i=l-1;i>=0;i--)         {             rev=rev+s.charAt(i);         }             if(s.equals(rev))             System.out.println("It is s...