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 do you mean by ‘void’ return type?

614


What is c++ good for?

593


What is nested class in c++?

524


Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

2077


Is atoi safe?

610






What it is and how it might be called (2 methods).

667


How do you declare a set in c++?

546


Do you need a main function in c++?

564


Will a recursive function without an end condition every quit, in practice a) Compiler-Specific (Some can convert to an infinite loop) b) No c) Yes

595


Is java as fast as c++?

616


What are structs in c++?

606


Is sorted c++?

586


Explain one-definition rule (odr).

657


What is a wchar_t in c++?

596


Explain what is oop?

623