#include <stdio.h>
int GCM(int x,int y)
{
int z;
while(x%y!=0)
{
z=x%y;
x=y;
y=z;
}
return(y);
}
int main()
{
int a,b,imax,imin,temp;
printf("please enter 2 numbers\n");
scanf("%d%d",&a,&b);
if(a<b)
{
temp=a;
a=b;
b=temp;
}
imax=GCM(a,b);
imin=a*b/GCM(a,b);
printf("the GCM is %d\n",imax);
printf("the LCM is %d\n",imin);
return 0;
}
int GCM(int x,int y)
{
int z;
while(x%y!=0)
{
z=x%y;
x=y;
y=z;
}
return(y);
}
int main()
{
int a,b,imax,imin,temp;
printf("please enter 2 numbers\n");
scanf("%d%d",&a,&b);
if(a<b)
{
temp=a;
a=b;
b=temp;
}
imax=GCM(a,b);
imin=a*b/GCM(a,b);
printf("the GCM is %d\n",imax);
printf("the LCM is %d\n",imin);
return 0;
}