Computer Notes, Programming codes, Hardware and Networking Tip, Entertainment, Biography, Internet Tip, Tech News, Latest Technology, YouTube,

QBASIC (Pattern Printing) 1, AA, 222, bbbb, 33333, cccccc

Pattern Type 
1
AA
222
bbbb
33333
cccccc


12345678910CLS
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
12345678910111213141516DECLARE 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
12345678910111213141516DECLARE 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

Click Here For More Patterns SET-1 in QBASIC Program

Click Here For More Patterns SET-2 in QBASIC Program


Post a Comment

Emoticon
:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.
disqus
facebook

MKRdezign

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget