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

Does anyone know what the answer is
who suggested that we feel sorry because we cry... afraid because we tremble
The volume of gas a balloon can hold varies directly as the cube of its radius. Imagine a balloon with a radius of 3 inches can hold 81 cubic inches of gas. H
Why do carbohydrate molecules function so well as fuel for the body?
why can't you mix the yolk from the inside of the shell of the eggs.
Is "words dying" personification? Please help! thanks
Teams of 4 are competing in a 1/4 mile relay race. Each runner must run the same exact distance. What is the distance each teammate runs?
An excel which cell contains =B2 is copied to row below, the same column. What will be the new cell's content
What is the limitations of CV
The length of a rectangular piece of land is 92 yards more than three times its width. The perimeter is 760 yards. find its dimensions.