write program for palindrome
Answer Posted / ashok
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int i,j,f=0;
char a[10];
clrscr (); // only works on windows
gets(a);
for (i=0;a[i]!='\0';i++)
{
}
i--;
for (j=0;a[j]!='\0';j++,i--)
{
if (a[i]!=a[j])
{
printf("string is not palindrome");
return(0);
}
}
printf("string is palindrome");
return(0);
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?
Is it legal in c++ to overload operator++ so that it decrements a value in your class?
Write a code/algo to find the frequency of each element in an array?
What are associate containers?
Is c++ an oop?
What parameter does the constructor to an ofstream object take?
What is #include ctype h in c++?
What does new return if there is insufficient memory to make your new object?
Explain object slicing in c++?
What is jump statement in C++?
what are Access specifiers in C++ class? What are the types?
Explain about Garbage Collector?
Difference between Abstraction and encapsulation in C++?
What is #include c++?
Why c++ is created?