quecy77quev quecy77quev
  • 04-08-2021
  • Computers and Technology
contestada

write a C++ program that receives a number as input from the user ,and checks whether it is greater than 8 and less than 10 or not and print the result
​

Respuesta :

khoa18050
khoa18050 khoa18050
  • 05-08-2021

num_in = float (input = ("Please enter a number from 0 to ten: "))

def cmp_num(num_in):

try:

if num_in > 8 and num_in < 10:

print ("{0} is greater than 8 and less than 10".format(num_in) )

elif num_in < 8 and num_in < 10:

print (" {0} is less than 8 and less than 10".format(num_in) )

else:

print ("{0} is out of the restriction".format (num_in))

except ValueError:

print ("Invalid input")

Answer Link

Otras preguntas

what are DNA's Five W's
An electromagnet is created using a battery, an insulated copper wire and an iron nail. The wire is wrapped around the nail 30 times and attached to the battery
A Patriot in North America in the 1770s would have MOST LIKELY supported which of these? (SS8H3c) DOK2 * 4 points A. boycotting British-made goods B. supporting
Amari rakes leaves for $10.85 per yard. If Amarirakes 5 yards, how much money does he have?
which statement about 4(x-3) is true A. 4(x-3) is a product B. 4(x-3) has three terms C. 4(x-3) has two terms D. 4(x-3) is a sum HELPPPP PLZ!!!!!!
who you want to be the president trump or biden ? explain why
What is a centromere
After the death of Mohammed, Mehmed II was chosen to be the leader of Islam. Please select the best answer from the choices provided T F
help ASAP find exterior angle, 20 points if u help me!!!
Tyler has a bat that weighs 44 ounces how many kilograms is it