String Palindrome Program in C

String Palindrome Program in C

Here you will know about Palindrome String and get the 3 different examples to check String Palindrome Program in C using 3 different ways in c language.

String Palindrome Program in C

What is palindrome?

A word, phrase, or sequence that reads the same forward and backward is called a palindrome.

For Example:-  malayalam, madam, racecar, noon, mam

Note:- Palindrome string program can check the palindrome number as input, but palindrome number program will give error if we input alphabets.

Algorithm of Palindrome

● Input a string

● Reverse string and store in another temp string variable

● Compare original and temp string

● If both string are same print message as “The String is Palindrome

● Otherwise print message as “The String is not Palindrome

String Palindrome Program in C using strrev

Output

String Palindrome Program in C output

 

 

 

String Palindrome Program in C using for loop

Output

Enter a string: racecar
racecar is a palindrome.

Enter a string: yamaha
yamaha is not a palindrome.

Palindrome Program in C using command line arguments

Output

C:\CodeRevise\c_programs>”palindrome program in c using command line arguments.exe” rajan
rajan is not a palindrome.

C:\CodeRevise\c_programs>”palindrome program in c using command line arguments.exe” madam
madam is a palindrome.

 

 

Check out our other C programming Examples

 

 

Leave a Comment

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

Scroll to Top