Skip to content

Instantly share code, notes, and snippets.

@jakobw
Created November 13, 2011 19:51
Show Gist options
  • Save jakobw/1362583 to your computer and use it in GitHub Desktop.
Save jakobw/1362583 to your computer and use it in GitHub Desktop.
Get two numbers from stdin, add them and show the result.
main = do
putStrLn "Enter a number"
n1 <- getLine
putStrLn $ n1 ++ " + ?"
n2 <- getLine
putStrLn $ n1 ++ " + " ++ n2 ++ " = " ++ (show $ read n1 + read n2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment