CLS DIM k(18) RANDOMIZE TIMER FOR i = 1 TO 18 k(i) = INT(RND * 50) PRINT k(i); IF k(i) MOD 5 = 0 THEN s = s + k(i) END IF NEXT i PRINT PRINT "S= "; s FOR i = 1 TO 18 IF k(i) = 20 THEN k(i) = 100 END IF NEXT i PRINT "NEW" FOR i = 1 TO 18 PRINT k(i); NEXT i END
DIM k(18)
RANDOMIZE TIMER
FOR i = 1 TO 18
k(i) = INT(RND * 50)
PRINT k(i);
IF k(i) MOD 5 = 0 THEN
s = s + k(i)
END IF
NEXT i
PRINT
PRINT "S= "; s
FOR i = 1 TO 18
IF k(i) = 20 THEN
k(i) = 100
END IF
NEXT i
PRINT "NEW"
FOR i = 1 TO 18
PRINT k(i);
NEXT i
END