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
How can a string be converted to a number?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
What are categories used for in c?
Explain how do you determine whether to use a stream function or a low-level function?
What are the advantages and disadvantages of a heap?
What are the similarities between c and c++?
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.
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What are reserved words with a programming language?
Whats s or c mean?
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?
What is the hardest programming language?
write a progrmm in c language take user interface generate table using for loop?
Why do we use main function?
What are structural members?