Check If Number Is Prime Haskell

[Solved] Check If Number Is Prime Haskell | Swift - Code Explorer | yomemimo.com
Question : check if number is prime haskell

Answered by : grumpy-goat-p8mf1bvp2brm

isPrime k = length [ x | x <- [2..k], k `mod` x == 0] == 1

Source : https://stackoverflow.com/questions/4690762/determining-if-a-given-number-is-a-prime-in-haskell | Last Update : Mon, 03 May 21

Answers related to check if number is prime haskell

Code Explorer Popular Question For Swift