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.

30 INPUT N35 IF N>INT N THEN GOTO 5040 LET R=N45 GOTO 10050 LET D=N-INT N60 IF D>0.5 THEN GOTO 9070 LET R=INT N80 GOTO 10090 LET R=(INT N)+l100 CLS110 PRINT N;" ROUNDS OFF TO ";R120 PRINT130 GOTO 1059 Two-Digit Round OffIt is possible to round off to the nearest hundredthsplace. That is, to two digits after the decimal point. Here'show:Program Listing10 LET R=Jf20 PRINT "GIVE ME A NUMBER TO"30 PRINT "MORE THAN TWO DECIMAL PLACES"40 PRINT50 PRINT "ORIGINAL NUMBER"60 INPUT N70 LET R=INT(lOO*N+0.05)/10080 CLS90 PRINT N;" ROUNDS OFF TO ";R100 PRINT110 GOTO 1076

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

Saved successfully!

Ooh no, something went wrong!