REM PROGRAM TO DISPLAY SQUARE OF AN INPUT NUMBER

CLS

INPUT “ENTER ANY NUMBER”; N

S = N ^ 2

PRINT “SQUARE OF NUMBER ”; S

END

USING SUB PROCEDURE

DECLARE SUB SQUARE (N)

CLS

INPUT “ENTER ANY NUMBER”; N

CALL SQUARE(N)

END

SUB SQUARE (N)

S = N ^ 2

PRINT “SQUARE OF NUMBER “; S

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION SQUARE (N)

CLS

INPUT “ENTER ANY NUMBER”; N

S = SQUARE(N)

PRINT “SQUARE OF NUMBER “; S

END

FUNCTION SQUARE (N)

SQ= N ^ 2

SQUARE = SQ

END FUNCTION

## No Comments