write program for palindrome

Answer Posted / pallavi attarde

#include<iostream.h>
#include<string.h>

int main()
{
char str[25],str1[25];
cout<<"Enter a string: ";

gets(str);

strcpy(str1,str);
strrev(str);
if(strcmp(str,str1)!=0)
{
cout<<"string is not palindrome";
}
else
{
cout<<"string is a palindrome";
}

cout<<endl;

Is This Answer Correct ?    596 Yes 248 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Would you rather wait for quicksort, linear search, or bubble sort on a 200000 element array? (Or go to lunch...) a) Quicksort b) Linear Search c) Bubble Sort

816


Ask to write virtual base class code?

2436


what does the following statement mean? int (*a)[4]

803


Explain linear search.

810


Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort

845






How the programmer of a class should decide whether to declare member function or a friend function?

853


Is it possible to write a c++ template to check for a function's existence?

768


What is purpose of abstract class?

760


What is the precedence when there is a global variable and a local variable in the program with the same name?

862


What is a breakpoint?

753


Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].

1179


What is a literal in c++?

724


How does work in c++?

800


What is a far pointer? where we use it?

788


Write a program to show polymorphism in C++?

816