For the conditional statement, I've tried to define some with it.
For example, defining a number greater than 500 as big,
(define (bigger-number n)
(cond
[(> n 500) "big"]
[else "Not too big"]))
(check-expect (bigger-number 30) Not too big)
(check-expect (bigger-number 555) big)
The greatest common divisor (GCD) of two non-negative integers (whole numbers) is a non-negative integer that
- divides both numbers, and
- is the largest non-negative number that does so.
For the GCD funtion, here are some examples,
(GCD 2 10)It is so much easier and convenient when you can find the GCD on the computer.
>2
(GCD 100 10)
>10
No comments:
Post a Comment