SHASHANGKA SHEKHAR'S BLOG

Hi, I am Shashangka Shekhar, Working with Microsoft Technologies. This is my personal blog where I share some of my experiences.

Palindromes

Dictionary meaning: a word, line, verse, number, sentence, etc., reading the same backward as forward, as Madam 

Palindrome in the C# language: A palindrome has the same letters on both ends of the string. This means “rotator” is a palindrome, but “advice” is not.

The simplest concept to test a string as a palindrome is to check if it’s the same reversed as it was originally. Thus our first C# palindrome function will reverse the entire string and compare it to the original.

Code Sample:

Out Put:
Enter a String to check for Palindrome:
Shashangka
Shashangka is not a palindrome
Original Input is = Shashangka
Reversed Input is = akgnahsahS

Post a comment