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

I don’t understand how to do the problem at all
help pls pls pls lol i know its a lot but thx
what was the national reclamation act
The spinal cord Select one: A. is characterized by conscious activity. B. forms memory engrams. C. links the peripheral nervous system to the brain. D. controls
help plssss will give brainlyst
1. Các kỹ năng nghe hiệu quả, ngoại trừ: A) Nghe xong rồi hãy nói B) Gác việc khác lại C) Hỏi đáp để ủng hộ người nói D) Cắt ngang lời người đang nói
What are the main beliefs of Hinduism
The people of this poem are the part of the * A) Beat Generation. B) Lost Generation. C) Harlem Renaissance. D) Black Panther Movement.
If s=13, find s-9. ________
what aspect of human psychological functioning is of particular interest to humanistic psychologists?