To check whether a string is a palindrome or not using C program, we need to use a char array for taking string input. It is because there is no string data type in the C language.

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

Basically, in the program, we are:

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

Palindrome String in C

Output

Palindrome string in C

Check whether string is palindrome o

That’s all for the palindrome string in C program. If you have any doubt then do comment below.

Leave a Reply

Close Menu