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

What do you mean by storage classes?

800


Can we use this pointer in a class specific, operator-overloading function for new operator?

620


What are the advantages of c++ over c?

586


Tell me what are static member functions?

616


What do nonglobal variables default to a) auto b) register c) static

652






How can you specify a class in C++?

803


Write about a nested class and mention its use?

630


What is rtti in c++?

629


Can union be self referenced?

580


What are the differences between java and c++?

536


Does c++ vector allocate memory?

534


What are the advantages of using typedef in a program?

645


Is c++ slower than c?

577


What is diamond problem in c++?

542


What is stack unwinding?

608