Calindrome string:
Calindrome string are those string which are
-palindrome
-Length is a multiple of 6.
program:
#include< stdio.h>
#include< string.h>
int main()
{
char s1[20],s2[20];
int i=0,len=0;
//input of string
cout<<"Enter string"<< endl;
cin>>s1;
// find length
while(s1[i++]!='')
len++;
//Now reverse
i=0;
while(s1[i]!='')
{
s2[i]=s1[len-i-1];
i++;
}
if(strcmp(s1,s2) || len%6!=0)
{
cout<<"String is not calindrome";
}
else
cout<<"String is calindrome";
}
Enter string
123321
String is calindrome
Enter string
12321
String is not calindrome