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 mode of the set of numbers below 25, 14, 33, 17, 14, 8 A. 14 B. 16 C. 17 D. 19
{(2,0), (4,0), (6,0), (8,0)}
Fill in the blanks using the list and the geographical information found in the Map pins.AcapulcoBaja CaliforniaCancúnCiudad JuárezGolfo de MéxicoMéxico, D.F.Mo
Help me 5th grade math sorry if I'm bothering ppl :(
It’s Integrated Chemistry
Hello!! Any topic for making a presentation about any subject ?? Please I need ideas
Calculate the mass of calcium chloride that contains 3.20 x 1024 atoms of chlorine.
Tom's current age is 5 times Mia's age 10 years ago. What is Tom's current age in terms of m?
Hahah I look pregnant don’t I
Expliquez dans vos mots, ce qu’un accommodement raisonnable à l’aide d’un minimum de deux exemples avec des motifs différents