write program for palindrome
Answer Posted / devunegi.negi
write program for palindrome in jdk........
import java.i.*;
class palindroame
{
public static void main(String args[])throws IEXception
int n,s,rev,m;
n=s
BufferedReader br =new BufferedReader(new InputStreamReader
(System.in));
System.out.println("Enter the Digit=");
s=Integer.parseInt(br.readLine());
While(s!=0)
{
m=s%10;
rev=(10*rev)+m;
s=s/10;
}
if(rev==n)
System.out.println("This number is Palindrome");
else
System.out.println("This number is Not palindrome");
}
Is This Answer Correct ? | 13 Yes | 9 No |
Post New Answer View All Answers
What are the advantages of c++? Explain
To what does “event-driven” refer?
How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?
What is abstraction in c++ with example?
Differences between private, protected and public and give examples.
What is size_type?
What does new do in c++?
What are the benefits of operator overloading?
When is the destructor called?
What is the purpose of templates in c++?
What is #include ctype h in c++?
In what situations do you have to use initialization list rather than assignment in constructors?
In a function declaration what does extern means?
What is the need of a destructor?
What is a block in c++?