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

one egg carton holds 12 eggs .how many cartons  are you able  to fill with 60 eggs.help me please.
Which lists all the integer solutions of the equation |x| = 7? a. –7 only b. –7 and 7 c. 0 and 7 d. 7 only
a square patio has an area of 200 square feet. how long is each side of the patio to the nearest 0.05?
"The product of 4 and a number plus 17 is 5" -translate and solve
write the following number in expanded and word form 5,325,603.712
round 8.293 to the nearest hundredths?
True or false: A voluntary association is typically a nonprofit organization formed to pursue some common interest.
Which three major rivers flow through the land claimed by france
What characterization of talks with Iran did McCain blame on Obama? Diplomatic Weak Without pre-condition Extremist
What is 56/100 in its simplest form