palindrome in java code

palindrome in java code

I need an example of palindrome in Java

View Answers

April 9, 2008 at 6:36 PM

Hi friend,

import java.io.*;

public class PalindromeExample{
public static void main(String [] args){
try{
BufferedReader object = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter number");
int num= Integer.parseInt(object.readLine());
int digit1, digit2, digit3, digit4, digit5;
int number=0;
digit1 = number % 10;
number = (number - digit1) /10;
digit2 = number % 10;
number = (number - digit2) /10;
digit3 = number % 10;
number = (number - digit3) /10;
digit4 = number % 10;
number = (number - digit4) /10;
digit5 = number % 10;
if ((digit1 == digit5) && (digit2 == digit4)){
System.out.print("Number is palindrome!");
}
else{
System.out.println("Number is not palindrome!");
}
}
catch(Exception e){
System.out.println("Out of range!");
}
}
}
---------------------

Now, read for more information

http://www.roseindia.net/java/beginners/Palindrome.shtml

Hope, it will help you.

amardeep.









Related Tutorials/Questions & Answers:
complete the code (palindrome) - Java Beginners
complete the code (palindrome)  Write a program that checks if a word is palindrome. A word is said to be palindrome if it reads the same forward...: noon noon is a palindrome. Enter a word: moon moon is not a palindrome
java palindrome
java palindrome  sir i need java program to print 1)integer palindrome 2)string palindrome
Advertisements
palindrome - Java Beginners
+ " is not a palindrome"); } } } For more information on Java... is palindrome. A word is said to be palindrome if it reads the same forward... noon is a palindrome. Enter a word: moon moon is not a palindrome.  Hi
palindrome - Java Beginners
palindrome  example of java program if it is a palindrome or not palindrome   Hi friend, Example to check the number is a palindrome...){ System.out.print("Number is palindrome!"); } else
Palindrome
Palindrome  program to verify palindrome
palindrome
palindrome  program to find the given string is palindrome or not   Hi Friend, Try the following code:ADS_TO_REPLACE_1 import java.util.... is palindrome"); } else{ System.out.println("String is not palindrome
palindrome - Java Beginners
palindrome in java code  I need an example of palindrome in Java ...;& (digit2 == digit4)){ System.out.print("Number is palindrome!"); } else{ System.out.println("Number is not palindrome!"
PALINDROME
PALINDROME  how to find palindrome of a number WITHOUT using a string ??   Hi Friend, Try the following code: import java.util.... == reversedNumber){ System.out.print("Number is palindrome!"); } else
palindrome
palindrome  write a program to print palindrome numbers between 500 to 700
To find palindrome no in a file - Java Beginners
To find palindrome no in a file  hi all i am having a problem...I wanted to write one java program where i have to count the no of palindrome...;Hi Prashant, Use the following code: import java.util.Scanner; import
palindrome - Java Beginners
palindrome  Write a program to find whether a given string is a palindrome or not  Hi Friend, Try the following code: import java.util.*; public class CheckPalindrome{ public static void main(String[] args
palindrome - Java Beginners
palindrome  determines whether or not it is a palindrome. if the number is not five... == digit4)){ System.out.print("Number is palindrome!"); } else{ System.out.println("Number is not palindrome!"); } } catch(Exception e  
palindrome
palindrome  how to write in string of palindrome?   import... is palindrome"); } else{ System.out.println("String is not palindrome
palindrome
palindrome  how to write in string of palindrome   import... is palindrome"); } else{ System.out.println("String is not palindrome
palindrome - Java Beginners
palindrome  import java.io.*; class Palindrome { System.out.println("Enter a word:"); BufferedReader br=new BufferedReader(new InputReaderStream(System.in)); String word; word=br.readLine(); public static void main
The Array Palindrome Number in Java
The Array Palindrome Number in Java       This is a Java simple palindrome number program... provide you the best explanation with the Java source code. Here we are going
Java Program to check Palindrome
Java Program to check Palindrome In this section, you will learn about palindrome in java and how to check any number that is palindrome or not. First of all what is palindrome number?, this is the number that the original number
Palindrome program in Java
Palindrome program in Java helps programmers to determine if a number.... The logic used in Java program behind finding a number or sting is palindrome.... Example of Palindrome program in Java: import java.io.*; public class
Finding all palindrome prime numbers - Java Beginners
Finding all palindrome prime numbers  How do i write a program to Find all palindrome prime numbers between two integers supplied as input (start and end points are excluded
Palindrome Number Example in Java
Palindrome Number Example in Java    ... the palindrome number and how to determine any number is palindrome or not. First of all we are going to read about the palindrome number.  This is the number
prime palindrome
prime palindrome  Hi I want to write a program in pascal that ask a user to input a number, the program then list all the prime number that are palindrome below the number entered. thks
prime palindrome
prime palindrome  Hi I want to write a program that ask a user to input a number, the program then list all the prime numbers that are palindrome below the number entered. In pascal language Thanks
To check a palindrome number?
To check a palindrome number?  program to check a number is palindrome or not using recursion?(wihout converting to string
ModuleNotFoundError: No module named 'palindrome'
ModuleNotFoundError: No module named 'palindrome'  Hi, My Python... 'palindrome' How to remove the ModuleNotFoundError: No module named 'palindrome' error? Thanks   Hi, In your python environment you
palindrome array problem
palindrome array problem  I'm having trouble figuring this assignment out. Can someone please help me? Generate (write the code) and save in an array Palidrome[250][5] all the 5 letter words using {a, b, c} Write the code
Check whether the number is palindrome or not
Check whether the number is palindrome or not A palindrome is a word, phrase... is palindrome or not. You can check it in various ways but the simplest method... if the reversed number is equal to the original. Here is the code: import java.util.
ModuleNotFoundError: No module named 'pp-palindrome'
ModuleNotFoundError: No module named 'pp-palindrome'  Hi, My... 'pp-palindrome' How to remove the ModuleNotFoundError: No module named 'pp-palindrome' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'qq_palindrome'
ModuleNotFoundError: No module named 'qq_palindrome'  Hi, My... 'qq_palindrome' How to remove the ModuleNotFoundError: No module named 'qq_palindrome' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'Trial-Palindrome'
ModuleNotFoundError: No module named 'Trial-Palindrome'  Hi, My... named 'Trial-Palindrome' How to remove the ModuleNotFoundError: No module named 'Trial-Palindrome' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'xj_palindrome'
ModuleNotFoundError: No module named 'xj_palindrome'  Hi, My... 'xj_palindrome' How to remove the ModuleNotFoundError: No module named 'xj_palindrome' error? Thanks   Hi, In your python
JAVA code For
JAVA code For   JAVA code For "Traffic signals Identification for vehicles
java code
java code  what is the code to turn off my pc through java program
JAVA CODE
JAVA CODE  JAVA SOURCE CODE TO BLOCK A PARTICULAR WEB SITES(SOCIAL WEB SITE
java code
java code  write a java code to convert hindi to english using arrays
java code
java code  hi any one please tell me the java code to access any link i mean which method of which class is used to open any link in java program
java code
java code  need java code for chart or graph which compare the performance of aprior algorithm and coherent rule algorithm.plz any one help me out
java code
java code  write a java code for finding a string in partiular position in a delimited text file and replace the word with the values given by user and write the file in new location
java code
java code  sir how to merge the cells in excel using java code please help me and also how to make the text placed in the cell to be center
java code
java code  sir how to merge the cells in excel using java code please help me and also how to make the text placed in the cell to be center
java code
java code  I need the java code that would output the following: HARDWARE ITEMS CODE DESCRIPTION UNIT PRICE K16 Wood screws,brass,20mm $7.75 D24 Wood glue,clear,1 liter $5.50 M93
Java code
Java code   Create a washing machine class with methods as switchOn, acceptClothes, acceptDetergent, switchOff. acceptClothes accepts the noofClothes as argument & returns the noofClothes
java code
java code  develop a banking system in java
java code
java code  HOW TO PRINT 1 TO 100 WITHOUT USING CONDITIONAL,ANY LOOP AND ARRAY IN JAVA AND C.URGENT SIR PLZ  Hi, You can use following code: class MyClass { public static void main(String[] args) { int
java code
java code  how to extract html tags using java
Java code
Java code  Write a program which performs to raise a number to a power and returns the value. Provide a behavior to the program so as to accept any... the following code: import java.util.*; import java.text.*; class NumberProgram
java code
java code  int g() { System.out.println("Inside method g"); int h() { System.out.println("Inside method h"); } } Find the error in the following... cannot define a method inside another method. Anyways, we have modified your code
java code
java code  what is meaning bufferedreader
java code
java code  what is meaning bufferedreader
java code
java code  i want HSVcolor descriptor for color image in java coding
Java code
Java code   Create a calculator class which will have methods add, multiply, divide & subtract   Hi Friend, Try the following code: class Calculation{ public int add(int a,int b){ return a+b

Ads