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


Please Help Members By Posting Answers For Below Questions

Explain register storage specifier.

586


What do you understand by pure virtual function? Write about its use?

574


daily Routine of father

901


What is the difference between cin.read() and cin.getline()?

553


Why c++ is faster than java?

590






Write a program in C++ for Fibonacci series

655


What is size of string in c++?

547


Describe the advantage of an external iterator.

610


give me an example for testing a program showing the test path .show how the test is important and complex.

2417


What is token c++?

574


What are dynamic type checking?

609


How would you find out if a linked-list is a cycle or not?

540


Why is main an int?

524


How to declare a function pointer?

573


Are vectors faster than arrays?

567