QBASIC Programming : N NE NEP NEPA NEPAL PATTERN
N NE NEP NEPA NEPAL PATTERN
251. WAP to display
N
NE
NEP
NEPA
NEPAL
USING SUB PROCEDURE
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
252. WAP to display
L
AL
PAL
EPAL
NEPAL
USING SUB PROCEDURE
DECLARE SUB PATTERN (S$)
CLS
S$ = "NEPAL"
CALL PATTERN(S$)
END
SUB PATTERN (S$)
FOR I = 1 TO LEN(S$)
PRINT RIGHT$(S$, I)
NEXT I
END SUB
253. WAP to display
NEPAL
EPAL
PAL
AL
L
USING SUB PROCEDURE
DECLARE SUB PATTERN (S$)
CLS
S$ = "NEPAL"
CALL PATTERN(S$)
END
SUB PATTERN (S$)
FOR I = LEN(S$) TO 1 STEP - 1
PRINT RIGHT$(S$, I)
NEXT I
END SUB
253. WAP to display
NEPAL
NEPA
NEP
NE
N
USING SUB PROCEDURE
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
254. WAP to display
N
E
P
A
L
USING SUB PROCEDURE
DECLARE SUB PATTERN (S$)
CLS
S$ = "NEPAL"
CALL PATTERN(S$)
END
SUB PATTERN (S$)
FOR I = 1 TO LEN(S$)
PRINT MID$(S$, I, 1)
NEXT I
END SUB
255. WAP to display
L
A
P
E
N
USING SUB PROCEDURE
DECLARE SUB PATTERN (S$)
CLS
S$ = "NEPAL"
CALL PATTERN(S$)
END
SUB PATTERN (S$)
FOR I = LEN(S$) TO 1 STEP -1
PRINT MID$(S$, I, 1)
NEXT I
END SUB
256. WAP to display
N
E
P
A
L
USING SUB PROCEDURE
DECLARE SUB PATTERN (S$)
CLS
S$ = "NEPAL"
CALL PATTERN(S$)
END
SUB PATTERN (S$)
FOR I = 1 TO LEN(S$)
PRINT TAB(I); MID$(S$, I, 1)
NEXT I
END SUB
257. WAP to display
L
A
P
E
N
USING SUB PROCEDURE
DECLARE SUB PATTERN (S$)
CLS
S$ = "NEPAL"
CALL PATTERN(S$)
END
SUB PATTERN (S$)
B = 1
FOR I = LEN(S$) TO 1 STEP -1
PRINT TAB(B); MID$(S$, I, 1)
B = B + 1
NEXT I
END SUB
257. WAP to display
NEPAL
EPA
P
USING SUB PROCEDURE
DECLARE SUB PATTERN (S$)
CLS
S$ = "NEPAL"
CALL PATTERN(S$)
END
SUB PATTERN (S$)
A = 1
FOR I = LEN(S$) TO 1 STEP -2
PRINT MID$(S$, A, I)
A = A + 1
NEXT I
END SUB
258. WAP to display
P
EPA
NEPAL
USING SUB PROCEDURE
DECLARE SUB PATTERN (S$)
CLS
S$ = "NEPAL"
CALL PATTERN(S$)
END
SUB PATTERN (S$)
A = 3
FOR I = 1 TO LEN(S$) STEP 2
PRINT MID$(S$, A, I)
A = A - 1
NEXT I
END SUB
259. WAP to display
NEPAL
EPA
P
USING SUB PROCEDURE
DECLARE SUB PATTERN (S$)
CLS
S$ = "NEPAL"
CALL PATTERN(S$)
END
SUB PATTERN (S$)
A = 1
FOR I = LEN(S$) TO 1 STEP -2
PRINT TAB(A); MID$(S$, A, I)
A = A + 1
NEXT I
END SUB
260. WAP to display
P
EPA
NEPAL
USING SUB PROCEDURE
DECLARE SUB PATTERN (S$)
CLS
S$ = "NEPAL"
CALL PATTERN(S$)
END
SUB PATTERN (S$)
A = 3
FOR I = 1 TO LEN(S$) STEP 2
PRINT TAB(A); MID$(S$, A, I)
A = A - 1
NEXT I
END SUB
261. WAP to display
*
**
***
****
*****
******
*******
USING SUB PROCEDURE
DECLARE SUB PATTERN (S$)
CLS
S$ = "*******"
CALL PATTERN(S$)
END
SUB PATTERN (S$)
FOR I = 1 TO LEN(S$)
PRINT LEFT$(S$, I)
NEXT I
END SUB
262. WAP to display
*******
******
*****
****
***
**
*
USING SUB PROCEDURE
DECLARE SUB PATTERN (S$)
CLS
S$ = "*******"
CALL PATTERN(S$)
END
SUB PATTERN (S$)
FOR I = LEN(S$) TO 1 STEP -1
PRINT LEFT$(S$, I)
NEXT I
END SUB
263. WAP to display
*
**
***
****
*
**
***
****
*
*
*
*
CLS
S$ = "****"
FOR I = 1 TO LEN(S$)
PRINT LEFT$(S$, I)
NEXT I
FOR J = 1 TO LEN(S$)
PRINT LEFT$(S$, I)
NEXT J
FOR K = 1 TO LEN(S$)
PRINT MID$(S$, K, 1)
NEXT K
END
USING SUB PROCEDURE
DECLARE SUB PATTERN1 (S$)
DECLARE SUB PATTERN (S$)
CLS
S$ = "****"
CALL PATTERN(S$)
CALL PATTERN(S$)
CALL PATTERN1(S$)
END
SUB PATTERN (S$)
FOR I = 1 TO LEN(S$)
PRINT LEFT$(S$, I)
NEXT I
END SUB
SUB PATTERN1 (S$)
FOR K = 1 TO LEN(S$)
PRINT MID$(S$, K, 1)
NEXT K
END SUB
Comments
Post a Comment