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

The indian ocean maritime system forged economic and social ties between a. morocco, arabia, and the mediterranean sea b. russia, india, and china c. east af
State the X- and Y- intercepts of each function. -1/2x + 3y = -3
7/8 students own a bike . 72 is the difference between the ones that own a bike and ones that do not. how many were surveyed?
we the people unit 5 help.
Using the research method you learned in the lesson, put the steps in the order in which they are performed.TitlesChoose a topicUse strong supporting evidence t
which branch declares war
The theory of plate tectonics developed in part from an earlier hypothesis about how continents move. What is the name of this earlier hypothesis? A. contine
2y-4x=-12 what is the slope intercept
Orange juice is _____. an acid a base a neutral
Where does the term carbohydrate come from?