Wednesday, October 16, 2019

102. Qbasic program to display 2 , 4, 8, 14, 22 …upto 10th terms

102. Write a program to display 2 , 4,  8, 14, 22 …upto 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 + 2
NEXT I
END SUB

1 comment: