Qbasic program to find sum of 10 user-input numbers
CLS
DIM N(10)
FOR I = 1 TO 10
INPUT "ENTER THE NUMBERS"; N(I)
S = S + N(I)
NEXT I
PRINT "SUM OF 10 NUMBERS"; S
END
USING SUB
DECLARE SUB SUM()
CLS
CALL SUM
END
SUB SUM
DIM N(10)
FOR I = 1 TO 10
INPUT "ENTER THE NUMBERS"; N(I)
S = S + N(I)
NEXT I
PRINT "SUM OF 10 NUMBERS"; S
END SUB
0 Comments