Greatest common divisor: Difference between revisions

Content added Content deleted
m (→‎{{header|AWK}}: portability)
No edit summary
Line 1,896: Line 1,896:
}
}
</lang>
</lang>

=={{header|Lisp}}==

I use [https://franz.com/downloads/clp/survey Allegro CL 10.1]

<lang lisp>
;; Project : Greatest common divisor
;; Date : 2018/03/10
;; Author : Gal Zsolt [~ CalmoSoft ~]
;; Email : <calmosoft@gmail.com>

(defun gcds(gcd b)
(loop while (> b 0)
do (setf c gcd)
(setf gcd b)
(setf b (mod c b)))
(write gcd))
(format t "~a" "Greatest common divisor 24 and 32: ")
(gcds 24 32)
</lang>
Output:
<pre>
Greatest common divisor 24 and 32: 8
</pre>


=={{header|LiveCode}}==
=={{header|LiveCode}}==