Thursday, October 17, 2019

141. Qbasic program to display NEPAL NEPA NEP NE N


141.      Write a program using SUB..........END SUB to display            -
                              NEPAL
                              NEPA
                              NEP
                              NE
                              N

DECLARE SUB PATTERN (S$)
CLS
S$ = "NEPAL"
CALL PATTERN(S$)
END

SUB PATTERN (S$)
FOR I = LEN(S$) TO 1 STEP - 1
PRINT LEFT$(S$, I)
NEXT I
END SUB

No comments:

Post a Comment