Algorithms_in_C 1.0.0
Set of algorithms implemented in C.
|
Problem 5 solution (Fastest). More...
#include <stdio.h>
Functions | |
unsigned long | gcd (unsigned long a, unsigned long b) |
Compute Greatest Common Divisor (GCD) of two numbers using Euclids algorithm. | |
unsigned long | lcm (unsigned long a, unsigned long b) |
Compute Least Common Multiple (LCM) of two numbers. | |
int | main (void) |
Main function. | |
Problem 5 solution (Fastest).
Solution is the LCM of all numbers between 1 and 20.
unsigned long gcd | ( | unsigned long | a, |
unsigned long | b | ||
) |
Compute Greatest Common Divisor (GCD) of two numbers using Euclids algorithm.
a | first number |
b | second number |
a
and b
unsigned long lcm | ( | unsigned long | a, |
unsigned long | b | ||
) |
Compute Least Common Multiple (LCM) of two numbers.
a | first number |
b | second number |
a
and b
int main | ( | void | ) |
Main function.