Find string palindrome 10marks

Answer Posted / coolcom(chandan)

void main()
{
int a,len,palin;
char s[20];

scanf("%s",s);

len=strlen(s);
printf("%d \n",len);

for(a=0,len=len-1;a<len;a++,len--)
{
palin=0;
if(s[a]==s[len])
palin=1;

else
{
printf("string %s is not palindrome",s);
getch();
exit();
}
}
printf("string %s is palindrome",s);
getch();

}

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a buffer in c?

566


Explain what is operator promotion?

623


What is null pointer constant?

588


write a program to concatenation the string using switch case?

1551


What is the purpose of scanf() and printf() functions?

709






What is a pointer on a pointer in c programming language?

611


What is the difference between #include and #include 'file' ?

601


Write a program to generate random numbers in c?

653


program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)

1616


why return type of main is not necessary in linux

1695


Is c is a high level language?

611


Why do we use stdio h and conio h?

625


What is 2 d array in c?

544


What is the purpose of void pointer?

590


explain what is fifo?

628