Saturday, January 19, 2019

Palindrome Number: A Palindrome number is a number that remains the same when its digits are reversed.
We get total 90 numbers between 100 and 1000.

public class PalindromeNumber {

public static void main(String[] args) {

int n=121;
int rev=0;
int temp=n;
while(n!=0){
rev=rev*10+n%10;
n=n/10;
}
if(temp==rev){
System.out.println(temp+" Is Palindrome");
}else{
System.out.println(temp+" Is Not Palindrome");
}
}
}

Related Posts:

  • Retrieve Test Data from an Excel file with Apache POI A Java Program to retrieve the data from an excel file?   Below is the code to read .xlsx file.                                XSSFWorkbo… Read More
  • ArrayList vs LinkedList Difference between ArrayList and LinkedList? Similarities: Both implements List interface(linkedlist also implements deque interface), maintains insertion order and can contain duplicate elements. Both are non synchroni… Read More
  • Why String is Immutable? What is mean by immutable object/class? Assume we have a below class A as mutable: Class A{ int i = 10; int j = 20; A a = new A(); } a.i = 30; a.j = 40; Changing state of objects, so A is mutable. Immutable: once o… Read More
  • Introduction to Software Testing Software Testing:  The process of verifying or validating an application with the intention of finding bugs or defect in software so that it could be corrected before product is delivered to the end user.   … Read More
  • Encapsulation in Java Encapsulation is to make sure that "sensitive" data is hidden from users. To achieve this, you must: declare class variables/attributes as private (only accessible within the same class) provide public setter and getter m… Read More

0 comments:

Post a Comment

Selenium Training in Realtime

Blog helps to a student or IT employee to develop or improve skills in Software Testing.

Followers

About Me

My photo
Hyderabad, Andhra Pradesh, India
I am Automation Testing Professional. I have completed my graduation in B.Tech (Computers) from JNTU Hyderabad and started my career in Software Testing accidentally since then, I passionate on learning new technologies

Contact Form

Name

Email *

Message *

Popular Posts