import java.util.*;
public class Palindrome
{
public static void main(String args[])
{
String original, reverse = "";
Scanner in = new Scanner(System.in);
original = in.nextLine();
int length = original.length();
for ( int i = length - 1 ; i >= 0 ; i-- )
reverse = reverse + original.charAt(i);
if(reverse.equals(original))
System.out.println("Yes String is palindrome");
else
System.out.println("NO String is not palindrome");
}
}
No comments:
Post a Comment