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

Male bowerbirds spend much of their time decorating their nests. What is the most likely reason the males would do this?   a. to cushion the nest for eggs an
Two rocks of same mass are rolling down a hill at different speeds (one faster than the other). Which rock would have more kinetic energy?
Help!! Number 39 please
In which forms of government is rule based on wealth or property ownership
Which feature of menu option of word processing program can you make images
What is five subtract x equals -2 how do you solve for x
What is the order of the tops of nuclear radiation from lowest to highest energy
Help math questions.20 points solve for xPlease show work if possible.
Which of the following is an example of quantitative data? A. a solution cantains copper ion B. A plant has five flowers C. A solar system has nine planets
explain the phrase, "like and equal are two different things," How does is idea help Meg?