185k views
0 votes
write an application that reads two floating point numbers and print their sum difference and product.

1 Answer

1 vote

Answer:

Sure, here's a simple Python application that reads two floating-point numbers from the user and prints their sum, difference, and product:

# Read two floating-point numbers from the user

num1 = float(input("Enter the first floating-point number: "))

num2 = float(input("Enter the second floating-point number: "))

# Calculate the sum, difference, and product

sum_result = num1 + num2

difference_result = num1 - num2

product_result = num1 * num2

# Print the results

print(f"Sum: {sum_result}")

print(f"Difference: {difference_result}")

print(f"Product: {product_result}")

To use this application, simply run it in a Python environment, and it will prompt you to enter two floating-point numbers. After you enter the numbers, it will calculate and display their sum, difference, and product.

Step-by-step explanation:

User PQW
by
8.0k points

No related questions found