COMP2113
COMP2113_ENGG1340 Programming technologies and Computer programming II [Section 2BC] [2023]
Loading...
Searching...
No Matches
calc.cpp
Go to the documentation of this file.
1// calc.cpp
2#include <iostream>
3#include "gcd.h"
4#include "lcm.h"
5using namespace std;
6
7int main() {
8 int a, b, c, d;
9 cout << "Please input two positive numbers: ";
10 cin >> a >> b;
11 c = gcd(a, b);
12 d = lcm(a, b);
13 cout << "GCD is " << c << endl;
14 cout << "LCM is " << d << endl;
15}
int gcd(int a, int b)
Definition 1.cpp:157
int main()
Definition calc.cpp:7
int lcm(int a, int b)
Definition lcm.cpp:8