QBASIC PATTERN : 1,10,101,1010,10101

QBASIC PATTERN : 1,10,101,1010,10101


1 10 101 1010 10101


CLS
 FOR I = 1 TO 5
 FOR J = 1 TO I
 PRINT J MOD 2;
 NEXT J
 PRINT
 NEXT I
 END

USING SUB


DECLARE SUB PATTERN()
 CLS
 CALL PATTERN
 END
 
 SUB PATTERN
 FOR I = 1 TO 5
 FOR J = 1 TO I
 PRINT J MOD 2;
 NEXT J
 PRINT
 NEXT I
 END SUB

Post a Comment

0 Comments