10 and 120 satisfy those requirements.
4 and 120
4 and 120
4 and 120
It is not possible to give a sensible answer to this question. The least common multiple (LCM) refers to a multiple that is COMMON to two or more numbers. You have only one number in the question: 120! The greatest common factor (GCF) refers to a factor that is COMMON to two or more numbers. You have only one number in the question: 10!
The GCF is 4.
The GCF of two numbers multiplied by their LCM will equal the product of the original numbers. If you know the GCF, divide it into the product of the two. The result will be the LCM. If the GCF of two numbers is 1, the LCM is their product.
If the GCF is 1, the LCM is the two numbers multiplied together.
#include<stdio.h> main() { int a,b,i,lcm,gcf; printf("\n Enter two numbers"); scanf("%d%d",&a,&b); for(i=0;i<=a;i++) { if((b%i==0)&&(a%i==0)) { gcf=i; } } lcm=a*b/gcf; printf("\n GCF is %d and LCM is %d",gcf,lcm); }
You need at least two numbers to find either an LCM or a GCF.
Since the product of two numbers is equal to the product of their GCF and LCM, the GCF of two numbers is equal to their product divided by their LCM and their LCM is equal to their product divided by their GCF.
The LCM of two numbers will never be less than the GCF.
The product of the GCF and the LCM of two numbers is equal to the product of the original two numbers. Multiply the GCF and the LCM. The original two numbers will be another factor pair of that total. Find the factor pair that has that GCF and LCM.