
-----------------------------------
lei4848
Sat Mar 25, 2006 6:17 pm

how to add decimal
-----------------------------------
i have a program below where the user enter a two digit number and it will output the same 2 digit numbers....i was wondering how you are able to add decimal such as 2.4 and the output will give you 2.4 

var str : string
var number : int := 0

get str
for i : 1 .. length (str)
number *=  10
number += (ord (str (i)) - 48)
end for
put number
put number * 2

-----------------------------------
person
Sat Mar 25, 2006 6:22 pm


-----------------------------------

var num : real
get num
put num


-----------------------------------
Delos
Sat Mar 25, 2006 6:31 pm


-----------------------------------
lei4848, you have been asked before to use [code] tags when posting code.  Please follow this convention.

-----------------------------------
TokenHerbz
Sat Mar 25, 2006 8:28 pm


-----------------------------------
just so you know...

you type you info here and when you post your code:
type this:


[code]
Print your code
[/code]

