My task is to make a sub program to calculate the greatest common divisor (factor) between two numbers. Here is my code thus far:
This is where I am getting stuck. I am familiar with the Euclidean Algorithm needed for this problem. However, I am not sure if I am using the Mod function correctly. Also, I do not know how to loop this back for the algorithm to work. I need for the new dividend to be (b*quotient) and for the divisor to be (Mod b*quotient). For extremely large nnumbers, this could get tedious. I need this code to work for any two numbers.![]()
Please Login or Register to view this content.
I only know the basic looping
etc.![]()
Please Login or Register to view this content.
How do I loop such an algorithm without doing it number by number?
Bookmarks