COMP2113
COMP2113_ENGG1340 Programming technologies and Computer programming II [Section 2BC] [2023]
Loading...
Searching...
No Matches
calc.cpp File Reference
#include <iostream>
#include "gcd.h"
#include "lcm.h"
Include dependency graph for calc.cpp:

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

◆ main()

int main ( void )

Definition at line 7 of file calc.cpp.

7 {
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 lcm(int a, int b)
Definition lcm.cpp:8

References gcd(), and lcm().

Here is the call graph for this function: