QBASIC PATTERN : 1, 121, 12321, 1234321, 123454321

QBASIC PATTERN : 1, 121, 12321, 1234321, 123454321


1 121 12321 1234321 123454321


CLS
 A# = 1
 FOR I = 1 TO 5
 PRINT A# ^ 2
 A# = A# * 10 + 1
 NEXT I
 END

USING SUB


DECLARE SUB PATTERN()
 CLS
 CALL PATTERN
 END
 
 SUB PATTERN
 A# = 1
 FOR I = 1 TO 5
 PRINT A# ^ 2
 A# = A# * 10 + 1
 NEXT I
 END SUB

Post a Comment

0 Comments