import java.util.*; import java.lang.*; class palindrome { public static void main(String args[]) { Scanner din=new Scanner(System.in); System.out.println("Enter a string: "); String str=din.next(); String rstr=new StringBuffer(str).reverse().toString(); if(str.equals(rstr)) System.out.println("Enterred string is palindrome."); else System.out.println("Enterred string isnt a palindrome string."); } }
WHAT'S NEW?
Loading...
0 comments:
Post a Comment