Consider the following C program
main()
{
int x, y, m, n;
scanf("%d %d", &x, &y);
/* Assume x>0 and y>0*/
m = x; n = y;
while(m != n)
{
if (m > n)
m = mn;
else
n = nm;
}
printf("%d", n);
}
The program computes

$x+y$ using repeated subtraction

$x \mod y$ using repeated subtraction

the greatest common divisor of $x$ and $y$

the least common multiple of $x$ and $y$