Saturday, December 31, 2016

QBASIC NUMBER SERIES PROGRAM 2, 4, 8, 14, 22, ………UP TO 15th TERM

 QBASIC NUMBER SERIES PROGRAM 
2, 4, 8, 14, 22, ………UP TO 15th  TERM

DECLARE SUB SERIES ( )
CLS
CALL SERIES
END

SUB SERIES
A = 2
B = 2
FOR I = 1 TO 15
    PRINT A,
    A = A + B
    B = B + 2
NEXT I
END SUB

No comments:

Post a Comment