-
-
Notifications
You must be signed in to change notification settings - Fork 18
gcd
Vašek edited this page Feb 7, 2019
·
3 revisions
This function returns the greatest common divisor of the given numbers
gcd(n, x)
Argument | Description |
---|---|
int n |
First number |
int x |
The other number |
Returns: int
The greatest common divisor of two numbers is the largest positive integer that divides each of the integers. For example: What is the greatest common divisor of 72 and 24?
Divisors of 72 are:
Divisors of 24 are:
Their greatest common divisor is 24.
int value = gcd(54, 24);
This function sets value
to 6.
Back to number_functions