Program to check whether string is palindrome or not
#include<stdio.h>
#include<string.h>
void main()
{
char *str,*p;
clrscr();
printf("Enter the string: ");
gets(str);
strcpy(p,str);
if(strcmp(p,strrev(str))==0)
printf("Entered String is palindrome.");
else
printf("Entered string is not palindrome");
getch();
}
No comments:
Post a Comment