Mode:
Duration:
1
2
3
4
5
6
7
8
proc isPrime(n: int): bool {
if n < 2 then return false;
for i in 2..n-1 {
if n % i == 0 then return false;
}
return true;
}
writeln(if isPrime(13) then "Prime" else "Not Prime");Coding works best on desktop or with an external keyboard.