PALINDROME WITH INBUILT FUNCTION
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char s1[20],s2[20];
int i=0;
printf("\n enter the string");
scanf("%s",&s1);
strcpy(s2,s1);
strrev(s1);
i=strcmp(s1,s2);
if(i==0)
{
printf("\n string is palindrome");
}
else{
printf("\n string is not palindrome");
}
}

No comments:
Post a Comment