Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; calculator function definition
- (defun calculator ()
- ; variable firnum as an input
- (princ "Enter the first number: ")
- (setq firnum (read))
- ; variable secnum as an input
- (princ "Enter the second number: ")
- (setq secnum (read))
- ; variable sumnum as a result of firnum + secnum
- (setq sumnum (+ firnum secnum))
- ; formated output with firnum and secnum as a text and sumnum as a decimal
- (format t "Sum of ~r and ~r is: ~D" firnum secnum sumnum))
- ; calculator function
- (calculator)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement