Dokument

· Back

C: GGT und kgV

172e8b71a56ca05c233108bb163c3e63 - 2004-05-20 09:54:25 - Mainberger, Gabriel

GGT

int a;

if(x>y)
a = x;
else
a = y;

while((x%b) || (y%a))
a = a+1;

return(a);

kgV

int a;

if(x>y)
a = x;
else
a = y;

while((a%x) || (a%y))
a = a+1;

return(a);