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

I will mark you brain list plz answer ​
If Angela ran to the bus and back to where she started what distance would she travel ?
Apart from Martin Luther,who below had a great influence on Protestant thought?
Where is (2,-6) located on the coordinate plane? Is it y-Axis or A-axis and what quadrant ?
Match up each scenario with the equation that models the word problem. Jeff is 3 years less than Tony's age. y = x-3 Skate rental charges an additional $3. y =
Mary has three baking pans. Each pan is 8"×8"×3" which expression will give her the total volume of the pans?
What document did Thomas Paine's Common Sense influence?
Klara wants to compare the price of a wallet she saw at Nordstrom Rack with other stores that may have the same wallet. She locates the product of three differe
Which of the following is NOT a part of an "I" statement?
Why might it be especially important to look closely at the context of political sources?