Wednesday, October 16, 2019

106. Qbasic program to display 1, 2, 4, 7, 11 up to 10th term.

106. Write a program to display  1, 2, 4, 7, 11 up to 10th term.
DECLARE SUB DISP( )
CLS
CALL DISP
END
SUB DISP ( )
A = 1
B = 1
FOR I = 1 TO 10
    PRINT A
    A = A + B
    B = B + 1
NEXT I
END SUB

4 comments: