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
What is the best c++ book?
What is a catch statement?
Why is c++ considered difficult?
the maximum length of a character constant can be a) 2 b) 1 c) 8
When does a name clash occur in c++?
What are the important differences between c++ and java?
Explain the volatile and mutable keywords.
How is new() different from malloc()?
Is c++ high level programming language?
In a function declaration what does extern means?
Should the this pointer can be used in the constructor?
What is the difference between object-oriented programming and procedural programming?
What is function overriding in c++?
What is the use of endl in c++?
What is the best way to declare and define global variables?