palindrome string program in c

In this tutorial, we will see how to check if String is palindrome or not.
A palindrome is a string which reads the same backward as forward.
For example:
MADAM is palindrome
There are many ways to check if String is palindrome or not.

  • Reversing the String and compare it with input String
  • Using iteration

Reversing the String and compare it with input String

Here is the simple program in which we will reverse the string and compare it with input String.

Output:

Enter a string:
racecar
racecar is a Palindrome

Using iteration

Here is the simple program.

Output:

Enter a string:
racecar
racecar is a Palindrome

That’s all about checking if String is palindrome or not in c.

Leave a Reply

Your email address will not be published. Required fields are marked *