[Tutor] Abs

Job jobrh2993 at gmail.com
Mon Jul 27 03:06:51 CEST 2015


I want to be able to ask a user to input an integer and print out the root and power of the given integer.

Why do you use abs(x) for this program?

I don't understand or see the link between abs() and root and powers.

This reminds me of this:
By knowing that when x%2==1 x is an odd number and when x%2 ==0 x is even, I was able to create a program that asked the user to enter 10 integers and printed out the largest odd number .

So If I understand how and why abs() is used to find the cube root of a perfect cube or how to use abs() to make the computer print out the root and power of a given integer I may make this program.

Thank you and forgive for my fuzzy thoughts.

Job



More information about the Tutor mailing list