write program for palindrome
Answer Posted / faiz misbah
#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 ? | 91 Yes | 84 No |
Post New Answer View All Answers
How a new operator differs from the operator new?
What are the uses of c++ in the real world?
How is computer programming useful in real life?
What is this pointer in c++?
which of the following is not an secondary constant a) array b) real c) union
Define macro.
What are the restrictions apply to constructors and destructors?
What are the advantages of early binding?
Are there interfaces in c++?
Can I uninstall microsoft c++ redistributable?
Write a c program for binary addition of two 8 bit numbers.
Explain the static member function.
In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?
Differentiate between a template class and class template in c++?
Can a new be used in place of old mallocq? If yes, why?