Computer Science Canada Mod command problem? i keep on getting the same error? |
Author: | batman12 [ Tue Dec 20, 2005 8:07 pm ] |
Post subject: | Mod command problem? i keep on getting the same error? |
hello, i am a grade 10 kid and we are learning in turing in our computer engineering course. we have to make a program that displays all the numbers for 1 to 1000 that is divisible by three. i used for loop using mod but i keep on getting the same error. any suggestion? thanks my solution %description:show the user all the integers that are divisible by 3 and show the result. for count:1..1000 if ((count mod 3 ))=0),then put " you can have", count ,"that are divisble by three." end loop I get this error saying " syntax error at ')' expected 'then'" please give me some suggestion that would help me out. i looked the at tutorials for for loops but didn't help me out. any sugggestions would be aprreciated. thanks. |
Author: | iker [ Tue Dec 20, 2005 8:33 pm ] | ||
Post subject: | |||
heres a suggestion: learn how to use [1]for loops [2]if commands [3]any other basic commands that you don't know The problem with your 'program', if thats what you want to call it, is that it isn't properly coded try using this as an example (var) is a variable (n#) is a number
|
Author: | batman12 [ Tue Dec 20, 2005 8:43 pm ] | ||
Post subject: | |||
iker wrote: heres a suggestion: learn how to use
it give me a error on the solution it gives me. can u please explain?thanks for the help iker.thanks.[1]for loops [2]if commands [3]any other basic commands that you don't know The problem with your 'program', if thats what you want to call it, is that it isn't properly coded try using this as an example (var) is a variable (n#) is a number
|
Author: | Bored [ Tue Dec 20, 2005 8:47 pm ] |
Post subject: | Re: Mod command problem? i keep on getting the same error? |
batman12 wrote: my solution %description:show the user all the integers that are divisible by 3 and show the result. for count:1..1000 if ((count mod 3 ))=0),then put " you can have", count ,"that are divisble by three." end loop I get this error saying " syntax error at ')' expected 'then'" please give me some suggestion that would help me out. i looked the at tutorials for for loops but didn't help me out. any sugggestions would be aprreciated. thanks. first off you don't need the brackets around count mod 3 they do absoloutely nothing and when it say error at ')' expected then it means that where you have the '),' you should have then and just delete the '),' i have no idea why you have them there |
Author: | Geminias [ Tue Dec 20, 2005 10:15 pm ] | ||||
Post subject: | |||||
syntax errors, put in simplest terms mean that there is an error in the format of your code. Change it to..
|