GCD and LCM
Greatest Common Denominator and Least Common Multiple
int gcd(int a, int b) {
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
}
return a;
}LCM (Least Common Multiple)
Last updated