Absolute value of a number

defati1983 Posted messages 54 Status Membre -  
 tfi -
Hello
I'm still just starting out in programming and I have a small problem... I want to know what to write to create a program that asks for the absolute value of a number... Thank you for replying quickly.

9 réponses

kilian Posted messages 8675 Registration date   Status Modérateur Last intervention   1 526
 
Hi,

The absolute value of a number is the number in positive no matter what, right?

So it's simple, in algorithm it would look like:
If (number < 0) then number := 0-number End If
11