QBASIC PROGRAM TO CALCULATE SUM OF FIRST TEN POSITIVE INTEGERS

QBASIC PROGRAM TO CALCULATE SUM OF FIRST TEN POSITIVE INTEGERS



CLS
 FOR I = 1 TO 10
 S = S + I
 NEXT I
 PRINT “SUM OF FIRST TEN POSITIVE INTEGERS” ; S
 END

USING SUB


DECLARE SUB SUM()
 CLS
 CALL SUM
 END
 
 SUB SUM
 FOR I = 1 TO 10
 S = S + I
 NEXT I
 PRINT “SUM OF FIRST TEN POSITIVE INTEGERS” ; S
 END

Post a Comment

0 Comments