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

Read the passage from "How Should One Read a Book?” Then turn from your blurred and littered pages to the opening pages of some great novelist—Defoe, Jane Aus
as materials move higher to lower concentration what is occurring
In late 2014, president obama ordered bombing raids against a radical sunni group that had seized large parts of territory in
Which of the following is a good example of a child's responsibility
What city was offered to President Lincoln as a Christmas gift from Sherman? Atlanta Charleston Petersburg Savannah
What fraction could be added to 1/4 to get a sum greater than 1
what was the goal of Reagan policy towards Nicaragua?????
Help please this is history
Why was the second red scare important
How many times can 1130 go into 0.37