Semiprime: Difference between revisions

Changed the function to return a boolean.
(Formatting. Replaced French "compte" by English "count".)
(Changed the function to return a boolean.)
Line 1,284:
 
=={{header|Nim}}==
<lang Nim>proc isSemiPrime(k: int): stringbool =
var
i = 2
Line 1,295:
else:
inc i
result = if count == 2: "is semi-prime" else: "isn't semi-prime"
for k in 1675..1680:
echo k, (if k.isSemiPrime(): " is", isSemiPrime(kelse: " isn’t"), " semi-prime"</lang>
 
{{output}}
Anonymous user