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


Please Help Members By Posting Answers For Below Questions

If you want to share several functions or variables in several files maitaining the consistency how would you share it?

548


What does the following code do: int c=0; cout< a) Undefined *Updated* b) 01 c) 00

628


What it is and how it might be called (2 methods).

654


Is c++ the most powerful language?

558


Difference between a homogeneous and a heterogeneous container

657






Describe linkages and types of linkages?

559


Are strings mutable in c++?

688


What is polymorphism in c++? Explain with an example?

599


Can I have a reference as a data member of a class? If yes, then how do I initialise it?

698


Can I create my own functions in c++?

590


Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.

781


Define token in c++.

705


Can you help me with this one? Make a program that when a user inputed a Product Name, it will display its price, and when the user inputed the quantity of the inputed product, it will show its total price. The output must be like this: Product Name: Price: Quantity: Total Price: ..this is the list of products to be inputed: Cellphone - 1500 Washing Machine - 5200 Television - 6000 Refrigirator - 8000 Oven - 2000 Computer - 11000 thanks..:D

3041


What is an undefined behavior and sequence points

557


How does code-bloating occur in c++?

741