Wednesday, October 16, 2019

103. Qbasic program to display 2, 4, 7, 11, 16 up to 10th terms.

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

No comments:

Post a Comment