Ad

Check if word entred is a palindrome or not !

A palindrome is a word, phrase, number or sequence of words that reads the same backwards as forwards.

Exemples : WOW, 12321, Anna, ...

Programme return true or false.

using System;

class Palindrome
{
  public static bool Check(string word){
    for(int i = 0; i < word.Length; i++)
    {
        word = word.ToUpper();
        if(i >= word.Length /2)
        {
            break;
        }
        if(word[i] != word[word.Length - 1 - i])
        {
            return false;
        }
    }
    return true;
  }
}