[ create a new paste ] login | about

Link: http://codepad.org/v9lKgeIk    [ raw code | output | fork ]

PHP, pasted on Feb 23:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php

function isPrimary($num){
    if ($num % 2 == 0 || $num % 3 == 0){
      return false;
    }

    return true;
}

for($i=5;$i<=100;$i++){
   if (isPrimary($i)){
       echo "$i\n";
   }
}


Output:
5
7
11
13
17
19
23
25
29
31
35
37
41
43
47
49
53
55
59
61
65
67
71
73
77
79
83
85
89
91
95
97


Create a new paste based on this one


Comments: