REM PROGRAM TO DISPLAY SQUARE ROOT OF AN INPUT NUMBER

CLS

INPUT “ENTER ANY NUMBER”; N

S = N ^ (1 / 2)

PRINT “SQUARE ROOT OF NUMBER ”; S

END

USING SUB PROCEDURE

DECLARE SUB SQROOT (N)

CLS

INPUT “ENTER ANY NUMBER”; N

CALL SQROOT(N)

END

SUB SQROOT (N)

S = N ^ (1 / 2)

PRINT “SQUARE ROOT OF NUMBER “; S

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION SQROOT (N)

CLS

INPUT “ENTER ANY NUMBER”; N

S = SQROOT(N)

PRINT “SQUARE ROOT OF NUMBER “; S

END

FUNCTION SQROOT (N)

SQ= N ^ (1 / 2)

SQROOT = SQ

END FUNCTION

## No Comments