Qbasic program to find sum of all numbers from 2 to 50
CLS
FOR I = 2 TO 50
S = S + I
NEXT I
PRINT “SUM OF NUMBERS BETWEEN 2 TO 50” ; S
END
USING SUB
DECLARE SUB SUM()
CLS
CALL SUM
END
SUB SUM
FOR I = 2 TO 50
S = S + I
NEXT I
PRINT “SUM OF NUMBERS BETWEEN 2 TO 50” ; S
END SUB
0 Comments