Greatest common divisor: Difference between revisions
Content deleted Content added
add try it online link |
|||
Line 5,047: | Line 5,047: | ||
gcd -47376 87843 |
gcd -47376 87843 |
||
# => 987</lang> |
# => 987</lang> |
||
==={{header|dash or bash}}=== |
|||
Recursive : |
|||
<lang bash> |
|||
gcd () { if [ "$2" -ne 0 ];then gcd "$2" "$(($1 % $2))";else echo "$1";fi } |
|||
gcd 100 75 |
|||
# => 25</lang> |
|||
==={{header|C Shell}}=== |
==={{header|C Shell}}=== |