This C program checks a given string whether it is a palindrome or not. The string is read from left to right and right to left and each character is matched. If all the characters in the input string match correctly, then it is a palindrome string, otherwise not.
This program is written using Dev C++ compiler version 126.96.36.199 on a Windows 7 64-bit system. You may use any ANSI C compiler and compile this program. The goal is to get an error-free program.
Before you get started with the program, we recommend you to learn the following C programming concepts for the better understanding of this example.
- C Printing Outputs
- C Reading Input Values
- C Arithmetic Operators
- C Logical Operators
- C Flow Control Structures
- C For Loop
A palindrome string is a special string which is same when you read it from left-to-right or right-to-left.
For example, the string “ToboT“, is same if you read it from left-to-right or right-to-left, therefore, it is a Palindrome.
When the program is executed, provide an input string to read and it will check whether it is a palindrome string or not and display the output to the console.
How does the program process the input string?