Thursday, October 17, 2019

142. Qbasic program to display. N NE NEP NEPA NEPAL


142.      Write a program using SUB……….END SUB to display.                        
N
NE
NEP
NEPA
NEPAL
DECLARE SUB PATTERN (S$)
CLS
S$ = "NEPAL"
CALL PATTERN(S$)
END

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

No comments:

Post a Comment