QBASIC (Pattern Printing) 1, AA, 222, bbbb, 33333, cccccc
Pattern Type
1
AA
222
bbbb
33333
cccccc
Method 1: Using SUB END SUB
Method 1: Using FUNCTION END FUNCTION
1
AA
222
bbbb
33333
cccccc
CLS s$ = "1A2b3c" FOR i = 1 TO LEN(s$) FOR j = 1 TO i PRINT MID$(s$, i, 1); NEXT j PRINT NEXT i END
Method 1: Using SUB END SUB
DECLARE SUB pattern(s$) CLS s$ = "1A2b3c" CALL pattern(s$) END SUB pattern (s$) FOR i = 1 TO LEN(s$) FOR j = 1 TO i PRINT MID$(s$, i, 1); NEXT j PRINT NEXT i END SUB
Method 1: Using FUNCTION END FUNCTION
DECLARE FUNCTION pattern$(s$) CLS r$ = pattern$(s$) END FUNCTION pattern$ (s$) s$ = "1A2b3c" FOR i = 1 TO LEN(s$) FOR j = 1 TO i PRINT MID$(s$, i, 1); NEXT j PRINT NEXT i END FUNCTION