Computer Science Canada

anti-factorial program help

Author:  blankout [ Tue May 17, 2011 4:07 pm ]
Post subject:  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
Turing:

%%%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

Author:  Tony [ Tue May 17, 2011 4:12 pm ]
Post subject:  RE:anti-factorial program help

What kind of an error?

Author:  blankout [ Tue May 17, 2011 4:13 pm ]
Post subject:  RE:anti-factorial program help

all i get told is syntax error at '='

Author:  Tony [ Tue May 17, 2011 4:19 pm ]
Post subject:  RE:anti-factorial program help

If it helps, you actual syntax error begins at rem

Author:  blankout [ Tue May 17, 2011 4:20 pm ]
Post subject:  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?

Author:  HRI [ Tue May 17, 2011 4:25 pm ]
Post subject:  RE:anti-factorial program help

rem is a binary operator. That means it takes two operands, much like + and -.

Author:  Raknarg [ Tue May 17, 2011 5:16 pm ]
Post subject:  RE:anti-factorial program help

Compare amount and divisor with rem instead.


: