Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- factorial n = if n == 0 then 1 else n * factorial (n - 1)
- main = do putStrLn "What is 5! ?"
- x <- readLn
- if x == factorial 5
- then putStrLn "Yepp!"
- else putStrLn "Nope, wrong!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement