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 is the primary source of fuel for the brain? a. proteins b. fats c. carbohydrates d. vitamins?
which of the following was a cause of war between the greek
A certain liquid has a density of 2.0 g/cm3 . 40.0 g of this liquid would occupy a volume of ___ cm3
The bell-shaped pattern that represents the frequency of intelligence test scores in the general population is called a:
Selina bought a shirt on sale that was 20% less than its original price.The original price was $5 more than the sale price. What was the original price?
How is the u.s. military restricted by the third amendment?
Did they call it the great depression during the great depression
Ms. brown's class will raise rabbits for their spring science fair. they have 24 feet of fencing with which to build a rectangular rabbit pen in which to keep t
Why is senatorial courtesy so important to a newly appointed judge?
Which pair shows processes that are the reverse of one another?