Home > Back-end >  To solve the
To solve the

Time:02-28

#include Int HCF (int int u, v)//the greatest common divisor, {int r; While ((r=u % v)!=0)//and division

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
  • Related