Computer Science, asked by schydv09, 5 months ago

To input two numbers depending upon user's choice add, subtract, multiply or divide the numbers​

Answers

Answered by Anonymous
4

Answer:

hello,

its a program using python

Explanation:

#program to input two numbers depending upon user's choice add, subtract, multiply or divide the numbers.

a=int(input("enter the first number"))

b=int(input("enter the second number"))

operator=str(input("enter the operator"))

if operator=="+":

   ans=a+b

   print("sum of ",a,"and",b,"is : ",ans)

elif operator=="-":

   ans=a-b

   print("difference of ",a,"and",b,"is : ",ans)

elif operator=="*":

   ans=a*b

   print("product of ",a,"and",b,"is : ",ans)

elif operator=="/":

   ans=a/b

   print("after dividing ",a,"by",b,"the ans is :",ans)

else:

   print("please choose some other operator")

______________________

hope it helps you

please mark brainliest

@ItzSnowySecret07


schydv09: thank you
Anonymous: u r welcome :)
Similar questions
Math, 11 months ago