xlang/test/sieve.x

20 lines
267 B
Plaintext
Raw Normal View History

2023-01-07 08:56:27 +00:00
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;
}
}