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

13. When you say that something is a factor, you mean that it is an) (factor) a. problem. b. obstacle. c. ingredient. d. fact
How does Troy's decision about making breakfast advance the plot?
I’m giving brainlest pls help meeee
Please select the word from the list that best fits the definition the title given to the Russian monarch
Procedural Justice: a) gives citizens the perceived understanding that the legal process is fair and equitable b) gives citizens the perceived understanding tha
The Martinez family picked 3 lb of apples. Ana picked for those apples, How many pounds of apples did Ana pick?
Which rays form the sides of
Need answer FAST!! (Something is incorrect in their work but I can’t figure it out) “Charlotte’s ice skates cost $30.45 less than her skateboard. Her ice skates
I need the answer ASAP
Atomic Structure -Past Paper Questions1)Q is radioactive. Radioactive substances are widely used in medicine, agricultureand industry. What is meant by the term