What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-02-07 01:15:15
greatest common factor
/* Function using "Euclidian Algorithm" to recursively find the greatest common divisor/factor (GCD/GCF) of 2 positive numbers*/ const gcf = function (small, large) { let r = large % small; if (r == 0) return small; else ... Add solution -
Javascript 2022-01-22 21:00:36
Write a JavaScript function called “GCD()” that takes the values from “Number 1“and “Number 2” then calculate the greatest common divisor of the two numbers and show the result as alert.
Write a JavaScript function called “GCD()” that takes the values from “Number 1“and “Number 2” then calculate the greatest common divisor of the two numbers and show the result as alert. Add solution -
CSS 2021-11-02 17:06:08
ptython math methods
math.acos() Returns the arc cosine of a number math.acosh() Returns the inverse hyperbolic cosine of a number math.asin() Returns the arc sine of a number math.asinh() Returns the inverse hyperbolic sine of a number math.atan() Returns the arc tangent of ... Add solution -
Javascript 2021-10-28 16:10:09
javascript reduce fraction
// Reduce a fraction by finding the Greatest Common Divisor and dividing by it. function reduce(numerator,denominator){ var gcd = function gcd(a,b){ return b ? gcd(b, a%b) : a; }; gcd = gcd(numerator,denominator); return [numerator/gcd, denomi... Add solution -
Java 2021-10-25 07:12:14
a recursive function that calculates the greatest common divisor from user's input in java
/** * Java program to demonstrate How to find Greatest Common Divisor or GCD of * two numbers using Euclid’s method. There are other methods as well to * find GCD of two number in Java but this example of finding GCD of two number * is most si... Add solution -
CSS 2021-10-05 11:10:05
ptython math constants
math.acos() Returns the arc cosine of a number math.acosh() Returns the inverse hyperbolic cosine of a number math.asin() Returns the arc sine of a number math.asinh() Returns the inverse hyperbolic sine of a number math.atan() Returns the arc tangent of ... Add solution