TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Check Palindrome String in C
Mr Shanawar
Jan 22
2016
Code
877
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
#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