write program for palindrome

Answer Posted / amrutha

String s1=args[0];
String s2="";

for(int i=0; i<s1.length(); i++)
{
s2=s2+charAt(i);
}
if(s1.equals(s2))
System.out.println("Palindrome");
else
System.out.println("Not Palindrome");

Is This Answer Correct ?    168 Yes 173 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe about storage allocation and scope of global, extern, static, local and register variables?

997


Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?

820


Explain data encapsulation?

858


Explain how the virtual base class is different from the conventional base classes of the opps.

885


What is meant by the term name mangling in c++?

710


What function initalizes variables in a class: a) Destructor b) Constitutor c) Constructor

893


What is static function? Explain with an example

800


Is dev c++ free?

784


What do you know about near, far and huge pointer?

787


What is private public protected in c++?

733


What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard

784


What are static variables?

800


How can I learn c++ easily?

818


What is the difference between mutex and binary semaphore?

820


What is the use of function pointer?

746