Wednesday, October 16, 2019

104. Qbasic program to display 2,6,12,20,30 …..up to 10th term

104. Write a program to display 2,6,12,20,30 …..up to 10th term
DECLARE SUB DISP( )
CLS
CALL DISP
END
SUB DISP ( )
A = 2
B = 4
FOR I = 1 TO 10
    PRINT A
    A = A + B
    B = B + 2
NEXT I
END SUB

No comments:

Post a Comment