Commit 1b344aad by arjun.b

calculator

parent fbfc87ad
n1=int(input("enter the first number")) n1=int(input("enter the first number"))
n2=int(input("enter the second number\n")) n2=int(input("enter the second number"))
print("1.ADD\n2.SUB\n3.MUL\n4.DIV\n") print("\n")
def add(n1,n2):
return n1+n2
def sub(n1,n2):
return n1-n2
def mul(n1,n2):
return n1*n2
def div(n1,n2):
return n1/n2
print("sum=",add(n1,n2))
print("sub=",sub(n1,n2))
print("mul=",mul(n1,n2))
print("div=",div(n1,n2))
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