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

The annual salary of each employee at an automobile plant was increased by 6% cost of living raise and then $2000 productivity raise. A) Write a function that t
What is the pH of 0.001 M H,SO4 (strong acid)? After mixing 250 ml 0.001 M H,SO, with 750 mL water, what is the pH now?
It is estimated that in Florida alone, almost 4,500 deaths occur annually due to __________ use. A. alcohol B. drug C. cocaine D. None of the above
Effective character encoding requires: a: standardized code. b: compatible browsers. c: common languages. d: identical operating systems.
(xy + 9y + 2) and (xy – 3)
the federal reserve system was created for which purpose
Expand. Your answer should be a polynomial in standard form. (b^2+5)(−b^2+7)=
who invented the telescope
What kind of change occurs when salt dissolves in water
Calculate the magnitude of the gravitational force exerted on a 4.20 kg baby by a 100 kg father 0.200 m away at birth (he is assisting, so he is close to the ch