to check whether a string is a palindrome or not
Anonymous
# include # include int main() { char str[10],strc[10]; int i,flag=1,j; gets(str); for(i=0,j=strlen(str)-1;i<=strlen(str)/2 && flag;++i,--j) if(str[i]!=str[j]) flag=0; if(flag) printf("Palindrome"); else printf("Not Palindrome"); return; }
Check out your Company Bowl for anonymous work chats.