Input
Output
#include <iostream> using namespace std; int main() { int a = 3, b = 4, i, j, t, gcd, lcm; cout <<"Enter two integers: "; cout << a << " " << b << endl; i = a; j = b; while (j > 0) { t = j; j = i % j; i = t; } gcd = i; lcm = (a*b)/gcd; cout << "Greatest common divisor(GCD or HCF) of "<<a <<" and "<< b <<" is " << gcd << endl; cout << "Least common multiple of "<< a <<" and "<< b <<" is " << lcm ; return 0; }