Created
April 16, 2017 06:45
-
-
Save muthugit/265c975085e9d5f0b4d7c7fe5f3d04cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Palindrome { | |
public static void main(String args[]) { | |
String original, reverse = ""; | |
original = "ABCCBA1"; | |
int length = original.length(); | |
for (int i = length - 1; i >= 0; i--) | |
reverse = reverse + original.charAt(i); | |
if (original.equals(reverse)) | |
System.out.println("Input string is a palindrome."); | |
else | |
System.out.println("Input string is not a palindrome."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment