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

What does the nocreate and noreplace flag ensure when they are used for opening a file?

667


Can class objects be passed as function arguments?

592


Can we change the basic meaning of an operator in c++?

647


Why are arrays usually processed with for loop?

761


What do you mean by volatile and mutable keywords used in c++?

568






What is c++ course?

572


What is the extraction operator and what does it do?

602


How do I get good at c++ programming?

590


what is upcasting in C++?

709


How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?

575


What does extern mean in a function declaration in c++?

689


an operation between an integer and real always yeilds a) integer result b) real result c) float result

699


What parameter does the constructor to an ofstream object take?

600


What is stack unwinding?

598


How can a called function determine the number of arguments that have been passed to it?

652