#include<iostream.h>
void main()
{
int x,y,r,a,b;
cout<<"enter the two numbers";
cin>>x>>y;
a=x;
b=y;
while(x%y!=0)
{
r=x%y;
x=y;
y=r;
}
cout<<"GCF="<<y<<"\n";
cout<<"LCM="<<a*b/y;
}
#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); }
=(3x) * (x^3+4x^2+9)
The GCF is 12. The LCM is 360.
The GCF is 4.
The GCF is 68, the LCM is 68
GCF is 2.LCM is 42.The GCF is 2.
The LCM is 11592. The GCF is 2.
The GCF refers to whole numbers, not decimals.
The GCF and LCM of 24 and 42 are 6 and 168 respectively.
Greatest Common Factor (GCF) for 72 168 is 24.Least Common Multiple (LCM) for 72 168 is 504.
The GCF is: 16The LCM is: 640The LCM is: 640
The 'c' in 'gcf' stands for "common". "Common" means "same for both". There's nothing common about one single item, and a single number has no 'common' factors. It takes at least two.