83
HIGHER MATH
Your ATARI Computer is a fancy calculator. When you enter two
numbers into the program below, the computer will tell you their
greatest common denominator. For example, if you enter 690911 and
11214017, you'll soon discover that their greatest common
denominator is 53147.
10 ? CHR$(125) :? "Enter two numbers. Press Return after
each entry. "
20 INPUT N 1 , N 2
30 G O S U B 90
40 ? "Their GCD is "; :? AN
50 POKE 752,1:POSITION 10,10: ? "Press Start to
continue."
60 IF PEEK(53279)<>6 THEN GOTO 60
78 POKE 752,0:? CHR$(125) :GOTO 10
80 R E M ****SUBROUTINE****
90 A N = 0 : P O K E 195,0:TRAP 130: M=(N1>=N2)*N1+(N2>N1)*N2:
N=(M=N1)*N2+(M=N2)*N1
100 IF INT(N1)<>N1 OR INT ( N 2 ) < > N 2 THEN R E T U R N
110 P=M-INT ( M / N ) * N : M = N : N = P
120 IF P < > 0 THEN GOTO 110
130 AN=M*(PEEK(195)=0):RETURN
Summary of Contents for 65XE
Page 1: ...ATARI 65XE PERSONAL COMPUTER OWNER S MANUAL TM...
Page 3: ...ATARI 65XE PERSONAL COMPUTER TM...
Page 6: ...Part 1 GettingStarted 1...
Page 9: ...4...
Page 23: ...18...
Page 25: ...20...
Page 32: ...Part 2 Programming withATARI BASIC 27...
Page 33: ...28...
Page 59: ...54...
Page 69: ...64...
Page 82: ...Part3 Appendices 77...
Page 83: ...78...
Page 97: ...92...
Page 105: ...100...
Page 125: ...120...
Page 126: ...121 Index...
Page 127: ...122...
Page 134: ...ATARI 1987 Atari Corp All Rights Reserved Printed in Taiwan C072018 001 REV B K l 2 1987...
Page 135: ......