Qbasic program to find/print sum of square of two numbers
CLS
INPUT “ENTER FIRST NUMBER”; A
INPUT “ENTER SECOND NUMBER”; B
S = A ^ 2 + B ^ 2
PRINT “SUM OF SQUARE OF TWO NUMBERS ”; S
END
USING SUB
DECLARE SUB SQUARE(A,B)
CLS
INPUT “ENTER FIRST NUMBER”; A
INPUT “ENTER SECOND NUMBER”; B
CALL SQUARE(A,B)
END
SUB SQUARE(A,B)
S = A ^ 2 + B ^ 2
PRINT “SUM OF SQUARE OF TWO NUMBERS ”; S
END SUB
0 Comments