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 difference between the functions memmove() and memcpy()?
How to tokenize a string in c++?
Define a nested class. Explain how it can be useful.
What c++ is used for?
what is pre-processor in C++?
What is the difference between the indirection operator and the address of oper-ator?
What is the benefit of encapsulation?
What is the use of namespace std in C++?
Out of fgets() and gets() which function is safe to use?
How many types of modularization are there in c++?
What are friend classes?
which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?
What is the use of data hiding?
How did c++ start?
Will a recursive function without an end condition every quit, in practice a) Compiler-Specific (Some can convert to an infinite loop) b) No c) Yes