LCM and HCF using c++
#include<iostream>
using namespace std;
int gcd(int a,int b)
{
if(a%b==0)
return b;
else
gcd(b,a%b);
}
int main()
{
int a,b;
cin>>a>>b;
int res = gcd(a,b);
cout<<"HCF : "<<res<<endl;
cout<<"LCM :"<<(a*b)/res;
return 0;
}