Computer Science, asked by Zyz, 1 year ago

write a program in java to input a range and display all prime palindrome numbers present between the range​

Answers

Answered by gurukulamdivya
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
Zyz: not only palindrome
Zyz: correct ur answer
Similar questions