Factorizing Numbers

Date: 198x
Type: Program
Platform(s): TS 1000

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10001 – 10050.

Related Products

Related Articles

Related Content

Image Gallery

Factorizing Numbers

Source Code

   5 REM %N%U%M%B%E%R% %F%A%C%T%O%R%S
 100 PRINT "FACTORIZING NUMBERS"
 101 PRINT 
 110 PRINT "WHATS YOUR MUMBER"
 120 INPUT N
 130 LET NN=N
 140 LET F=2
 150 LET S=SQR N
 160 LET PF=0
 170 PRINT ,,,,N;" = 1";
 200 IF N/F<>INT (N/F) OR NN=2 THEN GOTO 300
 220 PRINT "X";F;
 230 LET N=N/F
 240 LET PF=1
 250 GOTO 200
 300 IF PF=0 AND F>S OR N=1 THEN GOTO 400
 310 IF F=2 THEN LET F=1
 330 LET F=F+2
 340 GOTO 200
 400 IF PF=0 THEN PRINT " X ";NN;" PRIME NUMBER"
 410 PRINT 
 420 PRINT ,,"THATS ALL"
 430 PRINT AT 21,19;"PRESS ENTER"
 440 INPUT A$
 450 CLS 
 460 GOTO 5
 500 SAVE "1004%2"
 510 RUN 

People

No people associated with this content.

Scroll to Top