write program for palindrome

Answer Posted / baskaran

import java.io.*;

class Polindrome1{

public static void main(String args[])
throws IOException{

String s,p;
BufferedReader obj1=new BufferedReader(new
InputStreamReader(System.in));
s=obj1.readLine();
System.out.println("Input Value:"+s);
p=new StringBuffer(s).reverse().toString();
if(s.equals(p)){
System.out.println("This Input Is
Polindrome:"+s);}
else
System.out.println("The Input Value Is Not
Polindrome");

}

}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pointer to array in c++?

613


What is type of 'this' pointer? Explain when it is get created?

582


Write a program in C++ for Fibonacci series

655


How will you call C functions from C ++ and vice-versa?

653


What is function overloading in C++?

721






What are the steps in the development cycle?

611


Do the parentheses after the type name make a difference with new?

640


How would you use qsort() function to sort an array of structures?

714


What character terminates all character array strings a) b) . c) END

668


Does c++ have arraylist?

535


Describe the advantage of an external iterator.

612


Can I run c program in turbo c++?

575


What is the difference between new() and malloc()?

614


What is split a string in c++?

688


How is new() different from malloc()?

626