Mid2 1st_Arithmetic_Operations
a=int(input("Enter a number: "))
b=int(input("Enter a number: "))
ans1=a+b
print("Addition of",a,"and",b,"is",ans1)
ans2=a-b
print("Substraction of",a,"and",b,"is",ans2)
ans3=a*b
print("Multiplication of",a,"and",b,"is",ans3)
ans4=a/b
print("Division of",a,"and",b,"is",ans4)
ans5=a%b
print("Modulus of",a,"and",b,"is",ans5)
ans6=a//b
print("Floor division of",a,"and",b,"is",ans6)
ans7=a**b
print("Exponential of",a,"and",b,"is",ans7)
#output:
Enter a number: 10
Enter a number: 5
Addition of 10 and 5 is 15
Substraction of 10 and 5 is 5
Multiplication of 10 and 5 is 50
Division of 10 and 5 is 2.0
Modulus of 10 and 5 is 0
Floor division of 10 and 5 is 2
Exponential of 10 and 5 is 100000
Comments
Post a Comment