Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
437 B
6
Indexable
Never
public class MyClass {
    public static void main(String args[]) {
        for ( int i = 100; i < 1000; i++){
            if(Prime(i, i-1) == 1){
                System.out.println(i);
            }
      }
    }
    public static int Prime(int num, int div){
        if(div <= 1) 
        {
            return 1;
        }
        if(num % div == 0) 
        {
            return -1;
        }
        return Prime(num, div-1);
    }
}