C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Check Palindrome String in C
WhatsApp
Mr Shanawar
Jan 22
2016
997
0
0
#include<stdio.h>
#include<conio.h>
#include<string.h>
int
main()
{
char
string[6];
char
string2[6];
int
i=0;
printf(
"Enter string\n "
);
gets(string);
// copying string to string2
while
(string[i]!=
'\0'
)
{
string2[i]=string[i];
i++;
}
// Reverse characters of string2
strrev(string2);
if
(strcmp(string,string2)==0)
{
printf(
"String you entered is Palindrom"
);
}
else
{
printf(
"String you entered is not palindrome"
);
}
getch();
return
0;
}
C
Palindrome string
Palindrome String in C
Up Next
Check Palindrome String in C