#include <iostream>
using namespace std;
int main()
{
int a, b, temp, gcd, lcm, x, y;
cout << "Enter two number: ";
cin >> x>>y;
a = x;
b = y;
while(b!= 0)
{
temp = b;
b = a%b;
a = temp;
}
gcd = a;
lcm = x*y/gcd;
cout << "GCD is: "<<gcd<<"\nLCM is: "<<lcm<<endl;
system("pause");
}
using namespace std;
int main()
{
int a, b, temp, gcd, lcm, x, y;
cout << "Enter two number: ";
cin >> x>>y;
a = x;
b = y;
while(b!= 0)
{
temp = b;
b = a%b;
a = temp;
}
gcd = a;
lcm = x*y/gcd;
cout << "GCD is: "<<gcd<<"\nLCM is: "<<lcm<<endl;
system("pause");
}