how to create the program of LCM using c++


 void main()  
 {  
 clrscr();  
 int n1,n2,a,b,c,d;  
 cout<<"enter two no's"<>n1>>n2;  
 if(n1>n2)  
 {  
 a=n1;  
 b=n2;  
 }  
 else  
 {  
 a=n2;  
 b=n1;  
 }  
 do  
 {  
 c=a%b;  
 a=b;  
 b=c;  
 }  
 while(c!=0);  
 d=n1*n2/a;  
 cout<<"L.C.M is="<<d<<endl;  
 cout<<"H.C.F is="<<a<<endl;  
 getch();  
 }