DIM y(10)
i=0
FOR x=-4 TO 4.5 STEP 1
y(i)=5*COS(3*x)-6*SQR(x^2+4)
PRINT y(i); i
i=i+1
NEXT x
max=y(0)
kk=0
PRINT
FOR k=1 TO i
IF max<y(k) THEN max=y(k): kk=k
NEXT k
PRINT y(k);kk
DIM y(10)
i=0
FOR x=-4 TO 4.5 STEP 1
y(i)=5*COS(3*x)-6*SQR(x^2+4)
PRINT y(i); i
i=i+1
NEXT x
max=y(0)
kk=0
PRINT
FOR k=1 TO i
IF max<y(k) THEN max=y(k): kk=k
NEXT k
PRINT y(k);kk