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
When do we run a shell in the unix system?
What is iomanip c++?
What are the comments in c++?
I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.
What are the rules about using an underscore in a c++ identifier?
Where can I run c++ program?
If you want to share several functions or variables in several files maitaining the consistency how would you share it?
What is meant by a delegate?
What is the difference between a "copy constructor" and an "assignment operator" in C++?
What is pure virtual function? Or what is abstract class?
Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .
Write about the use of the virtual destructor?
What is the use of turbo c++?
What is the difference between map and hashmap in c++?
What are the important differences between c++ and java?