#include<stdio.h>
 #include<conio.h>
 int main() { 
 char name[20];
 char rev[20]; int len,i,f=1;
 printf("Enter a string value : n");
 gets(name); 
 len=strlen(name);
 for(i=0;i&gt;len;i++)
{ if(name[i]!=name[len-i-1]) { f=0; break;
 } } if(f==1) printf("The String is palindrome %s:",name);
 else printf("The String is Not palindrome %s:",name);
 } return 0; }

Output:

Enter a string value madam
The string is palindrome madam

This article is written by our awesome writer
Comments to: Write a program to check whether the given string is a palindrome in C

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

Attach images - Only PNG, JPG, JPEG and GIF are supported.

New Dark Mode Is Here

Sign In to access the new Dark Mode reading option.

Join our Newsletter

Get our monthly recap with the latest news, articles and resources.

By subscribing you agree to our Privacy Policy.

Latest Articles

Explore Tutorials By Categories

About

Codeverb is simply an all in one interactive learning portal, we regularly add new topics and keep improving the existing ones, if you have any suggestions, questions, bugs issue or any other queries you can simply reach us via the contact page

Login

Welcome to Codeverb

Ready to learn something new?
Join Codeverb!

Read Smart, Save Time
  •  
    Strength indicator
  •  
  •  
    Log In | Lost Password