HELLO
In last week i bored, and started to make a program that searches
PRIM numbers.
The program divides a number by 1,2,3,4... until the number.
And if Num1/Num2 (1,2,3,4...) = FLOOR(Num1/Num2) or CEIL(Num1/Num2)
the program increases Num1 by 1 and decreases Num2 to 1.
Here's the code:
REM ******PRIM NUMBER CALCULATOR******
REM ::::::::::::::::::::::::::::::::::
REM *************by Soma**************
n1#=2
n2#=1
Do
if returnkey()=1 then gosub waitandend
IF n1#<>n2#
IF n2#<>1
IF n1#/n2#=FLOOR(n1#/n2#) or n1#/n2#=CEIL(n1#/n2#)
n1#=n1#+1
Endif
Endif
Endif
IF n2#<>1 and n1#=n2#
Print "Prim number found? -> ",n1#
n1#=n1#+1
n2#=1
Endif
n2#=n2#+1
Loop
waitandend:
wait 3000
wait key
end
Soma