Created
November 13, 2011 19:51
-
-
Save jakobw/1362583 to your computer and use it in GitHub Desktop.
Get two numbers from stdin, add them and show the result.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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