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
Explain the difference between using macro and inline functions?
Does a derived class inherit or doesn't inherit?
What are the restrictions apply to constructors and destructors?
Differentiate between C and C++.
What is an adjust field format flag?
Explain terminate() function?
What are the differences between java and c++?
Is sorted c++?
What is extern c++?
What data structure is fastest, on average, for retrieving data: a) Binary Tree b) Hash Table c) Stack
Explain method of creating object in C++ ?
Define Virtual function in C++.
How to give an alternate name to a namespace?
Can constructor be static in c++?
What is the use of setprecision in c++?