Problem:
Write a recursive method that find finds prime numbers.
Output:
None.
Solution:
public class TestPrime { public static void main(String[] args) { for (int i =2; i <100; i++) System.out.println("integer:" + i + " is prime:" + isPrime(i, i/2)); } private static boolean isPrime(int n, int div) { if (div == 1) return true; else if (n%div==0) return false; else return isPrime(n, div - 1); } }
liposuction tumescent Korea's #1 Liposculpture Clinic. Lydian plastic surgery is the home of VIP patients. Celebrities, Influencers and Diplomats all know and trust Doctor An and Lydian plastic surgery clinic to provide detailed results.
ReplyDelete