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


Please Help Members By Posting Answers For Below Questions

How can a string be converted to a number?

506


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

2328


What are categories used for in c?

556


Explain how do you determine whether to use a stream function or a low-level function?

616


What are the advantages and disadvantages of a heap?

697






What are the similarities between c and c++?

591


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

1977


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

646


What are reserved words with a programming language?

593


Whats s or c mean?

587


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

2051


What is the hardest programming language?

659


write a progrmm in c language take user interface generate table using for loop?

1567


Why do we use main function?

626


What are structural members?

564