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

A good research paper should have A. a minimum of three main ideas. B. one main idea and at least three sub-topics. C. any number of main ideas. D. at least thr
Which continent has the most people? a. Africa b. North America c. Asia d. Europe
Which sentence uses the correct verbs? Select one of the options below as your answer:A. When we go to the lake, everybody in the whole family pitches in to hel
In what year did the Revolutionary War begin? A. 1754 B. 1763 C. 1775 D. 1781
Mention two successful (prominent) entrepreneurs. In South Africa. And discuss their role. In our society (8)
Nationalism encouraged people with a shared identity to
How many 1-inch cubes do you need to create a cube with an edge length of 5 inches?
What is pie in decimals
i need some idaes about a thesis statement about exctint animals!
what is 9x900+(1000x100