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


Please Help Members By Posting Answers For Below Questions

Why do we use vector in c++?

602


What is a character in c++?

565


What does std :: flush do?

689


What is the need of a destructor?

638


Explain Memory Allocation in C/C++ ?

636






What is a base class?

601


Is it possible for the objects to read and write themselves?

646


Is c++ a programming language?

594


List the merits and demerits of declaring a nested class in C++?

609


What is nested class in c++?

520


What are the 4 types of library?

595


Define pre-condition and post-condition to a member function in c++?

663


Explain deep copy and a shallow copy?

611


What is a singleton c++?

551


What is an inline function in c++?

627