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

QBASIC Pattern Printing Program (NEPAL, PAL, L)

Simple Program

1234567891011CLS
s$ = "NEPAL"
r = 1
t = 10
FOR i = 5 TO 1 STEP -2
    PRINT TAB(t); MID$(s$, r, i)
    r = r + 2
    t = t + 2
NEXT i
END

by using SUB END SUB

12345678910111213141516DECLARE SUB pat(a$)
CLS
a$ = "NEPAL"
CALL pat(a$)
END

SUB pat (s$)
    r = 1
    t = 10
    FOR i = 5 TO 1 STEP -2
        PRINT TAB(t); MID$(s$, r, i)
        r = r + 2
        t = t + 2
    NEXT i
END SUB

by Using FUNCTION END FUNCTION


1234567891011121314151617DECLARE FUNCTION pat$(a$)
CLS
a$ = "NEPAL"
p$ = pat$(a$)
END

pat$ (s$)
    a$ = "NEPAL"
    r = 1
    t = 10
    FOR i = 5 TO 1 STEP -2
        PRINT TAB(t); MID$(s$, r, i)
        r = r + 2
        t = t + 2
    NEXT i
END FUNCTION

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