Commit 5f5016d0 by ajil.k

test

parent 53c43d10
def add(n1,n2): def add(n1,n2):
sum=n1+n2 sum=n1+n2
print(sum) print("Sum: ",sum)
def subtract(n1,n2): def subtract(n1,n2):
difference=n1-n2 difference=n1-n2
print(difference) print("Difference: ",difference)
def def multiply(n1,n2):
num1 = float(input("Enter the first number")) product=n1*n2
num2 = float(input("Enter the second number")) print("Product: ",product)
add(num1,num2) def divide(n1,n2):
subtract(num1,num2) quotient=n1/n2
print("Quotient: ",quotient)
def moduloDivision(n1,n2):
remainder=n1%n2
print("Remainder: ",remainder)
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
i=1
while(i==1):
ch=int(input("------Enter Your Choice------\n1.Add\n2.Subtract\n3.Multiply\n4.Divide\n5.Modulus\n6.Enter 0 to exit\n"))
if ch==0:
i=0
elif ch==1:
add(num1,num2)
elif ch==2:
subtract(num1,num2)
elif ch==3:
multiply(num1,num2)
elif ch==4:
divide(num1,num2)
elif ch==5:
moduloDivision(num1,num2)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment