#include <stdio.h>
#include <string.h>
int main()
{
char a[100], b[100];
clrscr();
printf("Enter the string: ");
gets(a);
strcpy(b,a);
strrev(b);
if(strcmp(a,b) == 0)
printf("\nThe string is a Palindrome");
else
printf("\nThe string is not a Palindrome");
getch();
}
#include <string.h>
int main()
{
char a[100], b[100];
clrscr();
printf("Enter the string: ");
gets(a);
strcpy(b,a);
strrev(b);
if(strcmp(a,b) == 0)
printf("\nThe string is a Palindrome");
else
printf("\nThe string is not a Palindrome");
getch();
}
No comments:
Post a Comment