Python Compiler
num1 = int(input("Enter (int) num1 = ")); num2 = int(input("Enter (int) num2 = ")); min = (num1 < num2) and num1 or num2; print("\nCommon Divisors of %d and %d: " % (num1 , num2)) for i in range(1, min+1): if((num1 % i == 0) and (num2 % i == 0)): print(i, end=" ")
OUTPUT
Enter (int) num1 = 50
Enter (int) num2 = 100

Common Divisors of 50 and 100:
1 2 5 10 25 50
×

Save as Private