2271737281 2271737281
  • 26-01-2022
  • Computers and Technology
contestada

Write a program that accepts a number as input and prints just the decimal portion. This
program should run with numbers with decimals and numbers without decimals.

Respuesta :

s906236
s906236 s906236
  • 26-01-2022

Answer:

Let's code it using python. We can take care of the negative number by placing an absolute function at the end. Basically the decimal part is calculated by subtracting the integer part from the original input number

def decimal_print(number):

   int_part = int(number)

   decimal_part = number - int_part

   return abs(decimal_part)

Explanation:

Answer Link

Otras preguntas

What is the formula for germicide that is sufficient to kill blood-borne pathogens?
The scale of a map is 1 in. :500 mile. City A is 650 miles from City B. How far is it's distance on the map?
what fraction is 23/40
How do u divide monomials?
A contestant on a game show is given $100 and is asked five questions. The contestant loses $20 for every wrong answer. Is the graph discrete or continuous? Det
Why it is important to identify the health risks in your life
What kind of reaction occurs when you mix aqueous solutions of barium sulfide and sulfuric acid? what kind of reaction occurs when you mix aqueous solutions of
When was the first time hispanic heritage was celebrated in the usa?
Fish, like other animals, need oxygen to survive. oxygen gas dissolved in water can be used by fish, which remove it from the water by means of their grills. cl
Some teratogens have a threshold effect, which means that they are _____.