Answer:
number1 = int(input("Please type in one number: "))
number2 = int(input("Please type in a second number: "))
if number1 >=0 and number2 >=0:
print(str(number1) + " * " + str(number2) + " = " + str(number1 * number2))
else:
print("Please only enter numbers >= 0.")
print("Exiting program.")
Using a Loop:
while True:
number1 = int(input("Please type in one number: "))
number2 = int(input("Please type in a second number: "))
if number1 >=0 and number2 >=0:
print(str(number1) + " * " + str(number2) + " = " + str(number1 * number2))
print("Exiting program.")
else:
print("Please only enter numbers >= 0.")
print("Exiting program.")
break
Step-by-step explanation:
*The code is in Python.
Ask the user to enter two numbers
Check if they are both greater than or equal to 0. If they are, print their multiplication. Otherwise, print the remainder message
Print a message says "exiting program"
Note: Since I was not sure if the program keeps going until the user enters a negative value, I wrote two versions of the program. The one that uses the loop continues until the user enters a negative value.