Im trying to show that the following algorithm terminates when a,b are larger than zero. I tried it firstly by complete induction for (a,n) when n is any number but got stuck at the case that n > a. Is there other way to show it? thanks
while (a!=b) {
if (a>b)
a=a-b;
else
b=b-a;
}