Find GCD || for loop || Python
In this we are going to see a basic program on how to find gcd using for loop in Python Programming Language.


n1 = 25
n2 = 75
for i in range(1, n1 + 1):
    if i <= n2:
        if n1 % i == 0 and n2 % i == 0:
            g = i

print("\nThe GCD number of ", n1, " & ", n2, " is: ", g)

#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post