QBASIC CODE TO PRINT FIBONNACI SERIES

QBASIC CODE TO PRINT FIBONNACI SERIES


QBASIC SERIES : 1,2,3,5,8,13,21


CLS
 A = 1
 B = 2
 FOR I = 1 TO 9
 PRINT A;B;
 C = A + B
 A = B
 B = C
 NEXT I
 END

USING SUB


DECLARE SUB FIB()
 CLS
 CALL FIB
 END
 
 SUB FIB
 A = 1
 B = 2
 FOR I = 1 TO 9
 PRINT A;B;
 C = A + B
 A = B
 B = C
 NEXT I
 END SUB

Post a Comment

0 Comments