Write a C++ program to check whether a given string is a palindrome or not.

Example:

Palindrome String: A palindrome string is that string which in reverse is equal to the original string.

Basically, in the program, we need to implement the following steps:

  1. Taking string input from the user.
  2. Calculating the size of the string.
  3. Reverse the string.
  4. If the reverse of the string is not equal to the original string, then the string is not palindrome or else it id palindrome.

So let’s do the same in C++.

Output

palindrome string C++ Program output

If you have any suggestions or doubts then comment below.

Leave a Reply

Close Menu