diff --git a/addition.py b/addition.py index e184760..0531013 100644 --- a/addition.py +++ b/addition.py @@ -2,6 +2,6 @@ num2 = int(input("Enter second number: ")) # addition -result = num1 * num2 +result = num1 + num2 print("The sum of", num1, "and", num2, "is", result) diff --git a/gcd.py b/gcd.py index 3c39d8d..e6d8bdd 100644 --- a/gcd.py +++ b/gcd.py @@ -2,6 +2,11 @@ num2 = int(input("Enter second number: ")) # greatest common divisor -result = num1 + num2 +m=max(num1,num2) +n=min(num1,num2) +for i in range(1,n+1): + if(m%i==0 and n%i==0): + result=i + print("The GCD of", num1, "and", num2, "is", result)