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

43 Which element reacts spontaneously with 1.0M HCl (aq) at room temperature? (1) copper (3) silver(2) gold (4) zinc
Identify the surface ocean current that affects the climate of Eureka.
Objects fall at constant velocity
Which organelles are involved in energy conversion? A. mitochondria and chloroplasts B. mitochondria and ribosomes C. smooth and rough endoplasmic reticulum D.
For some audiences, musical change in the twentieth century was a bit too A. slow-paced. B. fast-paced. C. novel. D. modern.
What is the reaction of lead with sulphuric acid
cuantos dias hay en primera semana
The perfect square integers between 1 and 80 inclusive
Chinese cultural revolution leader mao zedong used which type of communication to talk to the masses
Garrett is 64 inches how many centimeters tall is he round your answer to the nearest tenth of a centimeter. 1 in.=2.54cm