Write a C Program to find lcm of two number ?
Today, let’s learn how to find LCM of two numbers in C Programming Language. But before executing the program, we will see what is LCM.
Least common multiple (LCM) The least common multiple (LCM) of two numbers is the smallest number that they both divide evenly into. In simple language,the smallest positive number that is a multiple of two or more numbers.
Code of the C Program to calculate the LCM of two numbers:
printf(“enter the value of n1,n2”);
for(i=2;i<=n1 && i<=n2;i++)
if(n1%i==0 && n2%i==0)
Leave a comment, if you have any querries or doubt.We will try our best to rectify your problem.