How to determine if given word is palindrome Palindrome is a word that spells same both backward or forward lets have a method the returns true or false based on the status of the word whether palindrome or not public bool IsPalindrome(string words) { //declare a variable named reverse and set it to empty string string reverse=string.Empty; for (var index=words.Length-1,index >=0;index--) { reverse +=words[index].ToString(); } if(reverse == words) return true; else return false; } static void Main(string[] args) { Console.WriteLine("Enter a word"); string words=Console.ReadLine(); var isPolindrome=IsPalindrome(words); if (isPolindrome) { Console.WriteLine("The ...
Csharp Naija is a blog that teaches C# programming using a practical guide. C# Nigeria is here to guide interested individual to the world of software Engineering.