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 is the return value of the insertion operator?
How one would use switch in a program?
Is it possible to get the source code back from binary file?
Are there interfaces in c++?
Define a nested class.
What is dev c++ used for?
How important is c++?
Give an example of run-time polymorphism/virtual functions.
What is the difference between containment and delegation?
Difference between strdup and strcpy?
Is dev c++ a good compiler?
What does new in c++ do?
Which one between if-else and switch is more efficient?
Are c and c++ similar?
Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.