[ create a new paste ] login | about

Link: http://codepad.org/GSrNOnHK    [ 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
8
9
10
11
13
14
15
16
17
19
20
21
22
23
25
26
27
28
29
31
32
33
34
35
37
38
39
40
41
43
44
45
46
47
49
50
51
52
53
55
56
57
58
59
61
62
63
64
65
67
68
69
70
71
73
74
75
76
77
79
80
81
82
83
85
86
87
88
89
91
92
93
94
95
97
98
99
100


Create a new paste based on this one


Comments: