write a program in java to input a range and display all prime palindrome numbers present between the range
Answers
Answered by
0
Here is your Answer:
public class PalindromeUptoN
{
public static void main(String[] args)
{
int n, b, rev = 0;
int limit=50;
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;
}
}
}
I hope this helped you so plz rate the answer
Zyz:
I need to check prime palindrome
Similar questions
Hindi,
6 months ago
Science,
6 months ago
India Languages,
1 year ago
English,
1 year ago
Accountancy,
1 year ago
Math,
1 year ago