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
Why do we use vector in c++?
What is a character in c++?
What does std :: flush do?
What is the need of a destructor?
Explain Memory Allocation in C/C++ ?
What is a base class?
Is it possible for the objects to read and write themselves?
Is c++ a programming language?
List the merits and demerits of declaring a nested class in C++?
What is nested class in c++?
What are the 4 types of library?
Define pre-condition and post-condition to a member function in c++?
Explain deep copy and a shallow copy?
What is a singleton c++?
What is an inline function in c++?