Wednesday, October 16, 2019

7. QBASIC Program to find cube of a given number

7.      Write a program in QBASIC to find cube of a given number using SUB…..END SUB.

DECLARE SUB CUBE (N)
CLS
INPUT “ENTER ANY NUMBER”; N
CALL CUBE (N)
END

SUB CUBE (N)
C = N ^ 3
PRINT “CUBE OF NUMBER “; C
              END SUB

No comments:

Post a Comment