- Try Code Live
-
Palindrome String
-
A palindrome string is a string that reads the same forward and backward.
Example:- "madam" → if you reverse it, it’s still "madam"
- "radar" → reversed is "radar"
- "hello" → reversed is "olleh" (not the same).
- "world" → reversed is "dlrow" (not the same)
using System; class Program { static void Main() { string input = "hello"; char[] charArray = input.ToCharArray(); Array.Reverse(charArray); string reversed = new string(charArray); if (input == reversed) Console.WriteLine("Palindrome"); else Console.WriteLine("Not Palindrome"); } }Not Palindrome