Write a c program that reads a string of characters and prints whether or not the entire string is palindrome.your program should ignore all blanks, numbers, punctuation and special characters and should be case sensitive
Answers
Answered by
1
void main()
{
char A[20],B[20],C[20];
int i,k=0;
gets(A);
for(i=0;i<strlen(A);i++)
{
if(!isalnum(A[i]))
{
B[k++]=A[i];
}
}
B[k]='\0';
strcpy(C,B);
strrev(C);
if(strcmp(C,B)==0)
printf("Palindrome");
else
printf("not palindrome");
return 0;
}
{
char A[20],B[20],C[20];
int i,k=0;
gets(A);
for(i=0;i<strlen(A);i++)
{
if(!isalnum(A[i]))
{
B[k++]=A[i];
}
}
B[k]='\0';
strcpy(C,B);
strrev(C);
if(strcmp(C,B)==0)
printf("Palindrome");
else
printf("not palindrome");
return 0;
}
Similar questions