158k views
2 votes
Write a program that:

a) Inputs TWO numbers and finds the average of both numbers, only if BOTH numbers are less than 100

User Khose
by
5.2k points

1 Answer

5 votes

Answer:

num1 = int(input("Enter number 1: "))

num2 = int(input("Enter number 2: "))

if num1 < 100 and num2 < 100:

newnum = num1 + num2

finalnum = newnum // 2

elif num1 >= 100 or num2 >= 100:

print("Invalid input.")

else:

pass

Step-by-step explanation:

Gg ez.

(I assumed the language was python. Next time, put what programming language you want it to be in.)

User MynameisJEFF
by
4.7k points