CodePudding user response:
Reference:# include & lt; Iostream. H>
#include
Int gys (int x, int y)//division algorithm common divisor
{
int a;
If (x{
A=x;
X=y;
Y=a;
}
While (x % y!=0)
{
A=x % y;
X=y;
Y=a;
}
The return of y;
}
Int GBS (int x, int y)//common multiple
{
Int result=(x * y)/(gys (x, y));
return result;
}
Int main (int arg c, char * argv [])
{
Int x, y;
Cout<& lt;" Please enter the two positive integers: ";
Cin> x> y;
Cout<& lt;" The greatest common divisor for: "& lt;Cout<& lt;" LCM is: "& lt;
system("pause");
return 0;
}
CodePudding user response:
The code and the demand for such online very much, suggest check myself, try to test