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
What is volatile keyword in c?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
Did c have any year 2000 problems?
What are the restrictions of a modulus operator?
Explain how many levels deep can include files be nested?
Why c is faster than c++?
what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555
What is #include cctype?
What is the difference between array and pointer in c?
How do shell structures work?
What is multidimensional arrays
How can I find out the size of a file, prior to reading it in?
What is an auto variable in c?
If the size of int data type is two bytes, what is the range of signed int data type?
What are the types of data structures in c?