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 are identifiers and keywords in c?
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
What is c programming structure?
What is the purpose of scanf() and printf() functions?
What will be your course of action for a push operation?
Write a program to show the change in position of a cursor using c
Describe the steps to insert data into a singly linked list.
Write a code to remove duplicates in a string.
Do pointers take up memory?
How can I ensure that integer arithmetic doesnt overflow?
What is #include called?
What are the types of type specifiers?
Differentiate between the = symbol and == symbol?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
Write a simple code fragment that will check if a number is positive or negative.