Im having trouble with a small program I've tried to make which finds prime numbers. I thought it would be a bit of fun, but it's turned out to be a pain in the neck. Im not exactly sure why but when I run it, it just prints all the odd numbers. I would appreciate anyone willing to take this problem on for me. Here is the code.
`the starting number to test for a prime number
a#=3
`the limit to c#
b#=a#/2
`the number a# will be divided by
c#=2
`do calc
calc:
`divides the number a# by c# where c# is a number less than or equal to half of a#
d#=a#/c#
`turns d# into an integer where d# is the answer to the calculation above
d=d#
`turns the integer d into a number e#
e#=d
`if d# and e# are the same then d# is an integer
If d#=e#
`so move on to next number
a#=a#+1
`make c=2
c#=2
goto calc
endif
If d#<>e# and c#<=b#
`if d# is not an integer make c#=c#+1
c#=c#+1
goto calc
endif
`if the number has been divided by every number up to half of itself
`except 1 and not produced an integer
If d#<>e# and c#>b#
`print a# as a prime number
Print a#
`make c#=2
c#=2
`move on to next number
a#=a#+1
goto calc
endif