QBASIC PROGRAM TO DISPLAY SUM OF SQUARE OF ANY THREE INPUT NUMBERS

QBASIC PROGRAM TO DISPLAY SUM OF SQUARE OF ANY THREE INPUT NUMBERS



 CLS
 INPUT “ENTER FIRST NUMBER”; A
 INPUT “ENTER SECOND NUMBER”; B
 INPUT “ENTER THIRD NUMBER”; C
 S = A ^ 2 + B ^ 2 + C ^ 2
 PRINT “SUM OF SQUARE OF THREE NUMBERS ”; S
 END

USING SUB


DECLARE SUB SUM(A,B,C)
 CLS
 INPUT “ENTER FIRST NUMBER”; A
 INPUT “ENTER SECOND NUMBER”; B
 INPUT “ENTER THIRD NUMBER”; C
 CALL SUM(A,B,C)
 END
 
 SUB SUM(A,B,C)
 S = A ^ 2 + B ^ 2 + C ^ 2
 PRINT “SUM OF SQUARE OF THREE NUMBERS ”; S
 END SUB

Post a Comment

0 Comments