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
"
5
using namespace
std;
6
7
int
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
}
gcd
int gcd(int a, int b)
Definition
1.cpp:157
main
int main()
Definition
calc.cpp:7
gcd.h
lcm
int lcm(int a, int b)
Definition
lcm.cpp:8
lcm.h
Module4
calc.cpp
Generated on Thu Nov 14 2024 10:59:44 for COMP2113 by
1.12.0