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 the four types of costs that a business must consider in making business decisions
at the ice cream shop there are 14 shakes sold every 6 malts what is the ratios of the shakes​
A store manager wants to order T-shirts with his new store logo. He's narrowed his color choices down to blue, red, white, or yellow. The store manager conducts
Over a period of years, the average rainfall in an area has decreased, causing environmental changes. Most likely to survive these environmental changes is a po
list 4 of animals that have been domesticated
what kind of energy does the soccer player transfer to the ball
Why does the us not support hamas?
you are assigned 32 math exercises for homework. you complete 87.5% of these before dinner. How many do you have left after dinner?
Would you rather use color tiles or your ruler to measure the length of an object? Explain your choic
What is the surface area of the triangular prism? A. 336cm^2 B. 312cm^2 C. 216cm^2 D. 288cm^2