Skip to content

Instantly share code, notes, and snippets.

@yemaw
Created February 14, 2013 10:09
Show Gist options
  • Save yemaw/4951737 to your computer and use it in GitHub Desktop.
Save yemaw/4951737 to your computer and use it in GitHub Desktop.
detect palindrome text or not.
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