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
What is const and volatile in c?
List some applications of c programming language?
Explain high-order bytes.
Explain why can’t constant values be used to define an array’s initial size?
What is the difference between array and linked list in c?
Explain 'bit masking'?
Write a program to reverse a string.
What does %p mean?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
What is the data segment that is followed by c?
how many errors in c explain deply
Write a program to know whether the input number is an armstrong number.
How does struct work in c?
Do you know the difference between exit() and _exit() function in c?
Why main function is special give two reasons?