Header Ads

Java Program to Print Palindrome Number in a Given Range

Python Program to Print Palindrome Number Between Two Number

Java, Program,Check,Number,Palindrome, Number is Palindrome, Number is Not Palindrome, Check the Number is Palindrome, Check the Number is not Palindrome, Program to Check the Number is Palindrome, Java Program to Print Palindrome Number in a Given Range

Example: Code Program

import java.util.*;
public class Palindrome {

public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int start, end,num, rem,rev, temp;
System.out.print("Enter Starting Number:");
start = sc.nextInt();
System.out.print("Enter Ending Number:");
end = sc.nextInt();

for(num = start; num<=end; num++) {
temp = num;
rev = 0;
while(temp>0) {
rem = (int)temp%10;
temp= (int)temp/10;
rev = rev*10+rem;

}
if(num == rev)
System.out.print(rev+"\t");
}

}

}

Output:

Java, Program,Check,Number,Palindrome, Number is Palindrome, Number is Not Palindrome, Check the Number is Palindrome, Check the Number is not Palindrome, Program to Check the Number is Palindrome, Java Program to Print Palindrome Number in a Given Range


Python Program


No comments

Powered by Blogger.