well, in your while loop, you set the gcd to one once it finds a common denominator. But then right after that you test the denominators again, and the remainder of any number divided by 1 is going to be 0. So unless you break from the while loop, it's just going to go forever

also, in my code, i made it loop until it hit either the numerator or the denominator. I think it's best to choose the one that's lowest and go until that one

Code:

void Fraction::lowterms()
{
int countTo=den;
if(num<den)
countTo=num;
for(int gcd = 2; gcd <= countTo; gcd++ )
while(!(num%gcd) && !(den%gcd) )
{
num = num / gcd;
den = den / gcd;
gcd = 1;
break;
}
}