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
what are the iterator and generic algorithms.
What does the linker do?
Why is main function important?
Can we use this pointer inside static member function?
How are virtual functions implemented in c++?
What is a stack c++?
Can we declare a base-class destructor as virtual?
Write a program in C++ for Fibonacci series
Explain the advantages of using friend classes.
Define a constructor?
Why can’t you call invariants() as the first line of your constructor?
Write about the role of c++ in the tradeoff of safety vs. Usability?
If I is an integer variable, which is faster ++i or i++?
What does it mean to declare a member function as static?
What is a pointer how and when is it used?