xlang/test/sieve.x

20 lines
267 B
Plaintext

main() : int {
print 2;
i := 3;
while i < 100 {
composite := false;
j := 3;
while j < i {
if i % j == 0 {
composite = true;
break;
}
j = j + 2;
}
if not composite {
print i;
}
i = i + 2;
}
}