12.07.2015 Views

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

50 LET M=N/L60 IF M=INT M THEN LET Q(L)=M70 NEXT L80 PRINT nFACTORS ARE:n90 FOR L=l TO N/2100 IF Q(L)>l THEN PRINT Q(L)105 IF Q(L)>l THEN GOTO 120110 LET Z=Z+l120 NEXT L130 IF N=l THEN PRINT nNONEn135 GOTO 145140 IF Z=INT N/2 THEN PRINT nNONEn150 CLS160 LET M=jf170 LET Z=jf180 GOTO 2052 Which is Smallest?How can the computer tell which number is smalleror larger? Here's how.Type in the program and RUN it. It will ask for, and accepta continuous string of numbers until you end the inputroutine by keying in a zero.Lines 40 to 60 make the decision as to which numberis lowest.Press any key to restart .Program Listing10 LET N=jf15 LET D=jf20 PRINT nGIVE ME A NUMBER n ,•25 INPUT Z30 IF Z=jf THEN GOTO 8035 PRINT Z40 LET N=N+l50 IF N=l THEN LET D=Z60 IF Z

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!