C++ GCF and LCM - repost
$2-8 USD/小时
I can give you this porject now.
Program of LCM:
#include
#include
int lcm(int a, int b)
{
int r=1;
if( r % b == 0 && r % a == 0)
return r;
r++;
lcm(a,b);
}
void main()
{
clrscr();
int a , b,l;
cout<>a;
cout<>b;
if(a>b)
l = lcm(a,b);
else
l = lcm(b,a);
cout<<"\n\n\nResult:\t"<<l;
getch();
}
Program of GCD:
#include
#include
int simplify(int num, int denom)
{
int r=1 , tn=0 , td=0;
if(num<denom)
{
tn=denom;
td=num;
}
else
{
tn=num;
td=denom;
}
while(r!=0)
{
r=tn%td;
tn=td;
td=r;
}
return tn;
}
void main()
{
clrscr();
int num , denom , result;
cout<>num;
cout<>denom;
result = simplify(num , denom);
cout<<"\n\n\nResult:\t"<<result;
getch();
}
项目ID: #4141832
关于项目
有9名威客正在参与此工作的竞标,均价$8/小时
Being a c++ programmer for 4 years, I can deliver you the Quality output on time. I am sure I will meet your expectations