Created
February 14, 2013 10:09
-
-
Save yemaw/4951737 to your computer and use it in GitHub Desktop.
detect palindrome text or not.
This file contains hidden or 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
string str = string.Empty; | |
Console.WriteLine("Enter a String"); | |
string s = Console.ReadLine(); | |
int i = s.Length; | |
for (int j = i - 1; j >= 0; j--) | |
{ | |
str = str + s[j]; | |
} | |
if (str == s) | |
{ | |
Console.WriteLine(s + " is palindrome"); | |
} | |
else | |
{ | |
Console.WriteLine(s + " is not a palindeome"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment