COMP2113
COMP2113_ENGG1340 Programming technologies and Computer programming II [Section 2BC] [2023]
Loading...
Searching...
No Matches
lcm.cpp
Go to the documentation of this file.
1// lcm.cpp
2#include <iostream>
3#include "gcd.h"
4#include "lcm.h"
5using namespace std;
6
7// for simplicity, we assume both inputs to be positive
8int lcm(int a, int b) {
9 return a / gcd(a, b) * b;
10}
int gcd(int a, int b)
Definition 1.cpp:157
int lcm(int a, int b)
Definition lcm.cpp:8