Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
GCD
//Title of this code //V8 3.31.1 function gcd(a,b) { var greatest_divisor = 1; var divisor = 2; if (a<2 || b<2) print(greatest_divisor); else if (a<0 || b<0) print("error"); else { while (a>=divisor && b>=divisor) { if (a%divisor==0 && b%divisor==0) { greatest_divisor = divisor; } divisor++; } print(greatest_divisor); } } gcd(33,55);
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
braille renderer, in javascript
Precio Helado
Viktor Schelochkov
random2
More JS
BF.JS
containsPalindrome
JS exam part 2 - BPM
Javascript Basics
Try
Please log in to post a comment.