You're rewriting the code already given to you. Don't do that. Here's the old loop:
Code:
for(d = 2; d<min; d++)
if(((a%d)++0) && ((b%d) ==0)) break;
It's the
same thing as this:
Code:
for(d = 2; d<min; d++)
{
if(((a%d)++0) && ((b%d) ==0))
{
break;
}
}
Undertand what it's doing. It's cycling through all posibilities to divide a and b by d, starting with 2 and moving all the way up until it reaches either a or b, whichever is lowest. If it can't find a common denominator by then, there is none. If it found one, it doesn't need to search anymore, so it breaks the loop.
You changed the entire loop to include everything else after it. Take that stuff out and put it after the loop.
Outside of changing the obviously weird ++ to a ==, I don't think you should be altering much else.