Find string palindrome 10marks
Answer Posted / babitha
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--)
{
if(s[a]==s[len])
palin=1;
else
break;
}
if(palin==1)
printf("string %s is palindrome",s);
else
printf("string %s is not palindrome",s);
getch();
}
| Is This Answer Correct ? | 18 Yes | 10 No |
Post New Answer View All Answers
Can we declare a function inside a function in c?
What are the differences between new and malloc in C?
What does s c mean in text?
What is static memory allocation?
Why can arithmetic operations not be performed on void pointers?
What is the difference between Printf(..) and sprint(...) ?
Explain what is a static function?
What are the different types of endless loops?
What are local variables c?
What would be an example of a structure analogous to structure c?
write a program to rearrange the array such way that all even elements should come first and next come odd
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
Is there any demerits of using pointer?
Which function in C can be used to append a string to another string?
What is build process in c?