
-----------------------------------
blankout
Tue May 17, 2011 4:07 pm

anti-factorial program help
-----------------------------------
I am trying to create an anti-factorial type program, however i am having some problems when it comes to ending the statement; I keep recieving an error regarding the = sign


PLEASE NOTE: i made this in about 5 minutes so i know its terrible coding and such

any help would be appreciated

%%%anit-factorial program%%%
var amount : real
get amount
cls
var  divisor: int := 1
loop
    put amount div divisor
    divisor := divisor + 1
    exit when (amount div divisor) rem not = 0
end loop




P.S. i am using turing 4.1.1

-----------------------------------
Tony
Tue May 17, 2011 4:12 pm

RE:anti-factorial program help
-----------------------------------
What kind of an error?

-----------------------------------
blankout
Tue May 17, 2011 4:13 pm

RE:anti-factorial program help
-----------------------------------
all i get told is syntax error at '='

-----------------------------------
Tony
Tue May 17, 2011 4:19 pm

RE:anti-factorial program help
-----------------------------------
If it helps, you actual syntax error begins at rem

-----------------------------------
blankout
Tue May 17, 2011 4:20 pm

RE:anti-factorial program help
-----------------------------------
ok thanks well i was trying to get the loop to exit when the remainder is not equal to zero, any help?

-----------------------------------
HRI
Tue May 17, 2011 4:25 pm

RE:anti-factorial program help
-----------------------------------
rem is a binary operator. That means it takes two operands, much like + and -.

-----------------------------------
Raknarg
Tue May 17, 2011 5:16 pm

RE:anti-factorial program help
-----------------------------------
Compare amount and divisor with rem instead.
