Computer Science, asked by Vansh9951, 1 year ago

Write A Java Program To Print The First 100 Palindromic Prime Numbers .

Answers

Answered by rishabhshah2609
1

Answer:

Explanation:

public class PalindromicPrime { public static void main(String[] args) { final int total = 100; final int displayPerLine = 10; int count = 1; int number = 2; while (count <= total) { if (isPrime(number) && isPalindrome(number)) { System.out.print(number + " "); if (count % displayPerLine == 0) System.out.println(); count++; } number++; } } /* Test if the number is Prime */ public static boolean isPrime(int num).

Similar questions