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..f66d895 100644 --- a/gcd.py +++ b/gcd.py @@ -1,7 +1,8 @@ +import math num1 = int(input("Enter first number: ")) num2 = int(input("Enter second number: ")) # greatest common divisor -result = num1 + num2 +result = math.gcd(num1,num2) print("The GCD of", num1, "and", num2, "is", result) diff --git a/simple_interest.py b/simple_interest.py index 88d4325..ff86fa5 100644 --- a/simple_interest.py +++ b/simple_interest.py @@ -3,6 +3,6 @@ time = float(input("Enter the number of years for the investment: ")) # Simple Interest Calculation -interest = (principal * rate * time) +interest = (principal * rate * time)/100 print("The simple interest for an investment of", principal, "at", rate, "% for", time, "years is:", interest)