Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 anti-factorial program help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
blankout




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue May 17, 2011 4:12 pm   Post subject: RE:anti-factorial program help

What kind of an error?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
blankout




PostPosted: Tue May 17, 2011 4:13 pm   Post subject: RE:anti-factorial program help

all i get told is syntax error at '='
Tony




PostPosted: Tue May 17, 2011 4:19 pm   Post subject: RE:anti-factorial program help

If it helps, you actual syntax error begins at rem
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
blankout




PostPosted: 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?
HRI




PostPosted: 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 -.
Raknarg




PostPosted: Tue May 17, 2011 5:16 pm   Post subject: RE:anti-factorial program help

Compare amount and divisor with rem instead.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: