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

Which of the following is an oxidation-reduction reaction? SO2(g) + H2O(l)  H2SO3(aq) CaCO3(s) CaO(s) + CO2(g) Ca(OH)2(s) + H2CO3(l) CaCO3(aq) + 2H2O(l) C6H1
Suprax belongs to the third generation of what type of drug?
solving systems by substitutions
During the 1850s, what congressional action led to sectional tensions and the formation of a new political party
Anyway you can help me out?
identify the isotope that has atoms with 12 neutrons, 10 protons and 10 electrons
You test 8 automobiles of the same make and model and find their mileage ratings to be 27, 27, 28, 29, 32, 33, 34, and 1,000,000 mpg, arranged in order from sma
what is the main idea of laissez faire
PLEASE HELP ME!!!!!!!!!!!!! Choose the adjective that best describes the italicized word. The cat scrambled up the tree. Cat is the Italicized word. black frig
How does the age of seafloor sediments change with increasing distance from the ocean ridge?