doubt in MIT scheme
Asked by
sameer
I don't understand how this one works.
(define balance 1000)
(define (withdraw amount)
(if (or (< amount balance) (= amount balance))
(begin (set! balance (- balance amount)) balance) "Insufficient amount"))
If I type (withdraw 50) the output is 950.
and again if i type (withdraw 50) the output is 900.
My doubt is that again it should print 950.
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask sameer for more information if necessary.
To post a message you must log in.