Create a program that will let you input two numbers and will display its SUM, DIFFERENCE, PRODUCT and QUOTIENT. P
Answers
Answer:
Program in javascript:
function display(num1,num2) {
console.log('Sum is' + num1 + num2')
console.log('Difference is' + num1 - num2)
console.log('Product is' + num1*num2)
console.log('Quotient is' + num1 % num2)
}
Explanation:
print("Calculator")
op = input("A or S or M or D?").lower()
if op == "a":
print("Enter two numbers: ")
first = float(input("First: "))
second = float(input("Second: "))
sum = first + second
print("Sum: " + str(sum))
elif op == "s":
print("Enter two numbers: ")
first = float(input("First: "))
second = float(input("Second: "))
diff = first - second
print("Difference: " + str(diff))
elif op == "m":
print("Enter two numbers ")
first = float(input("First: "))
second = float(input("Second:"))
mul = first * second
print("Product: " + str(mul))
else:
divid = float(input("divident: "))
divis = float(input("divisor: "))
quo = divid / divis
rem = divid % divis
print("Quotient: " + str(quo))
print("Remainder:" + str(rem))