Saturday, 14 September 2024

Practical - 55 - Write a program in Python which accepts two numbers and calculate their sum, difference, multiplication and division.

Practical - 55 - Write a program in Python which accepts two numbers and calculate their sum, difference, multiplication and division.


Ans:

a=int(input("Enter first number: "))

b=int(input("Enter second number: "))

print("Sum=",a+b)

print("Difference=",a-b)

print("Multiplication=",a*b)

print("Division=",a/b)

 

Output:

Enter first  number: 8

Enter second number: 5

Sum= 13

Difference= 3

Multiplication= 40

Division= 1.6


No comments:

Post a Comment