USING SUB PROCEDURE

DECLARE SUB GREAT ()

DECLARE SUB SMALL ()

DIM SHARED N(20)

CLS

FOR I = 1 TO 20

INPUT "ENTER THE NUMBERS"; N(I)

NEXT I

CALL GREAT

CALL SMALL

END

SUB GREAT

G = N(1)

FOR I = 2 TO 20

IF N(I) > G THEN G = N(I)

NEXT I

PRINT "GREATEST NUMBER"; G

END SUB

SUB SMALL

S = N(1)

FOR I = 2 TO 20

IF N(I) < S THEN S = N(I)

NEXT I

PRINT "SMALLEST NUMBER"; S

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION GREAT ()

DECLARE FUNCTION SMALL ()

DIM SHARED N(20)

CLS

FOR I = 1 TO 20

INPUT "ENTER THE NUMBERS"; N(I)

NEXT I

PRINT "GREATEST NUMBER"; GREAT

PRINT "SMALLEST NUMBER"; SMALL

END

FUNCTION GREAT

G = N(1)

FOR I = 2 TO 20

IF N(I) > G THEN G = N(I)

NEXT I

GREAT = G

END FUNCTION

FUNCTION SMALL

S = N(1)

FOR I = 2 TO 20

IF N(I) < S THEN S = N(I)

NEXT I

SMALL = S

END FUNCTION

## No Comments