xlang/test/sieve.x
2023-01-07 09:56:27 +01:00

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;
}
}