Write a java Program to print palindrome number upto N numbers

Write a java Program to print palindrome number upto N numbers

Write a java Program to print palindrome number upto N numbers

Program
public class Main 
{
    public static void main(String[] args) 
    {
        int n, b, rev = 0;
        int limit=200;
        System.out.print("Palindrome numbers from 1 to N:"); 
        for (int i = 1; i <= limit; i++)
        {
            n = i;
            while (n > 0) 
            {
                b = n % 10;
                rev = rev * 10 + b;
                n = n / 10; 
            }
            if (rev == i)
            {
                System.out.print(i + " ");
            } 
            rev = 0;
        }
    }
}


Output:

Palindrome numbers from 1 to N:
1
2
3
4
5
6
7
8
9
11
22
33
44
55
66
77
88
99
101
111
121
131
141
151
161
171
181
191



More Questions


35 . Write a java Program to check the given number is Palindrome or not
36 . Write a java Program to print palindrome number upto N numbers
37 . Write a java Program to print N prime numbers and find sum and average
38 . Write a Java Program to find largest number in an array
39 . Write a Program to find second largest number in an array
40 . Write a Program to Find largest and smallest number in an array in java
41 . Write a Java Program to find largest and second largest in an array
42 . Write a java program to find the index of the largest number in an array
43 . Write a java program to Find the index of the smallest number in an array
44 . Write a Program to remove duplicate element in an array
45 . Write a java Program to print odd and even numbers from an array



For latest job updates join Telegram Channel: https://t.me/sateeshm

Apply For The Job

Apply For Job

Java Material

Python Material

PLSQL Material

.Net Material

Java Practice Programs

400 Java Programs