Simple Program

CLS
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

DECLARE 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


DECLARE 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