c++ program to find lcm of two numbers
#include
using namespace std;
int main(){
int num1,num2,temp,lcm,hcf;
cout<<"Enter 1st number"<>num1;
cout<<"Enter 2nd number"<>num2;
if (num1>=num2){
temp=num1;
num1=num2;
num2=temp;
}
for (int i=1 ; i<=num1 ; i++){
if (num1%i==0 && num2%i==0){
hcf=i;
}
}
// MATHEMATICAL FORMULA : HCF * LCM = NUM1 * NUM2
lcm = (num1*num2)/hcf;
cout<<"Least Common Multiple of "<
|