REM PROGRAM TO DISPLAY SUM OF CUBE OF ANY TWO INPUT NUMBERS

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

C = A ^ 3 + B ^ 3

PRINT “SUM OF CUBE OF TWO NUMBERS ”; C

END

USING SUB PROCEDURE

DECLARE SUB CUBE (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

CALL CUBE (A, B)

END

SUB CUBE (A, B)

C = A ^ 3 + B ^ 3

PRINT “SUM OF CUBE OF TWO NUMBERS “; C

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION CUBE (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

C = CUBE (A, B)

PRINT “SUM OF CUBE OF TWO NUMBERS “; C

END

FUNCTION CUBE (N)

CB= A ^ 3 + B ^ 3

CUBE = CB

END FUNCTION

## No Comments