C Programming
Computer Programming

Program in c to Find Lowest Common Multiple(LCM) of two Numbers



Write a Program in c to Find Lowest Common Multiple(LCM) of two Numbers

\* C Program to to Find Lowest Common Multiple(LCM) of two Numbers *\

# include < stdio.h >
int   main( )
{

int   num1, num2, i, gcd  ;
printf(" Enter the first Number : ") ;
scanf("%d ", & num1) ;
printf("\n Enter the second Number : ") ;
scanf("%d ", & num2) ;
i = 1 ;
do
{

if(   num1  % i   == 0   &&  num2   % i   == 0   )
gcd = i ;
i = i + 1 ;

}
while (   i   <=   10 ) ;
lcm = ( num1 * num2 ) / gcd ;
printf(" Lowest Common Multiple of Entred Number is : ") ;
printf("%d ", lcm) ;
return ( 0 ) ;

}

Output of Program :

Output of Program in C to Find Lowest Common Multiple(LCM) of two Numbers