Previous Post: Next Post:
C #2-Addition of two number with C Program C #4-Palindrome String or not using C Program
C #2-Addition of two number with C Program C #4-Palindrome String or not using C Program
What is palindrome?
A palindrome is word or a phrase or a sequence that remains same when it is read from
backward as well forward remains same.
Example: Madam, Radar, Refer, Level, .....etc..
Let's think with programming stuff's....
Source Code:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[100], b[100];
clrscr();
printf("Enter the String to check :");
gets(a);
strcpy(b,a);
strrev(b);
if (strcmp(a,b)==0)
{
printf("The given string is palindrome");
}
else
{
prrintf("The given string is not a palindrome");
}
getch();
}
Output:
Enter the string to check:
Madam
Thanks and regards,
Tech Bird
Comments