I scripted a code for finding GCD of 2 numbers and the method process is correct but in some special cases like 4 and 8 it doesn't work
I had scripted a code to find a gcd of 2 numbers by the book method of getting the factors, then the common factors and at last multiplying all common factors. It works too but there are some special cases for example 4 and 8.
This is my source code
Since it is for my practical examination I ought to get my own logic..
I tried to find GCD by the textbook method of finding the factors then the common factor and at last multiplying all the common factors and it seems to work too but gets stuck at few special cases like 4 and 8.
source https://stackoverflow.com/questions/77297374/i-scripted-a-code-for-finding-gcd-of-2-numbers-and-the-method-process-is-correct
Comments
Post a Comment