Greatest Common Factor Function
Posted on 1997-04-16
I am attempting to write a C++ function that evalutes two integers and calculates their greatest common factor(Once using a post test loop and once using a pretest loop, so two examples!). I have been generally succesful, but in some instances my function has failed. How would you write such a function and implement error checking for two int's with no common factor?