A Program That Read Two numbers & Display LCM (Least Common Multiple).

#include<stdio.h>
#include<conio.h>
#include<iostream.h>

void main()
{
    int a,b;
    clrscr();
    cout<<"Enter 1st number = ";
    cin>>a;
    cout<<"Enter 2nd number = ";
    cin>>b;
   
    int c=1;
    for(int i=2;i<=a && i<=b;i++)
    {
       while(a%i==0 && b%i==0)
       {
          a=a/i;
          b=b/i;
          c=c*i;
       }
    }
   
    c=c*a*b;
    cout<<"Least Common Multiple(LCM) = "<<c;
    getch();
}

///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........