Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
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
976
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;
}
Palindrome string
C
Palindrome String in C
Up Next
Check Palindrome String in C