Posted: Sat Mar 25, 2006 6:17 pm Post subject: 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
Sponsor Sponsor
person
Posted: Sat Mar 25, 2006 6:22 pm Post subject: (No subject)
code:
var num : real
get num
put num
Delos
Posted: Sat Mar 25, 2006 6:31 pm Post subject: (No subject)
lei4848, you have been asked before to use [code] tags when posting code. Please follow this convention.
TokenHerbz
Posted: Sat Mar 25, 2006 8:28 pm Post subject: (No subject)
just so you know...
you type you info here and when you post your code:
type this: