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

DEBASHIS said…
R
AC
ING
what will be the program code
Unknown said…
cls
a$="racing":a=1
for i=1 to len(a$)
? mid$(a$,a,i)
a=a+1
next
end
Unknown said…
HOW ABOUT THIS -

*
***
*****
*******
*********

PLS SEND FAST
Unknown said…
I mean pyramid shape .
Unknown said…
how to print
N
NE
NEP
NEPA
NEPAL
but.....in function procedure plz teach me fast within tommsrow is my send up
Deepshikha said…
$
$$$
$$$$$
$$$
$
Pls tell me how to solve
Gopal Khanal said…
This comment has been removed by the author.
Unknown said…
*
***
*****
*******
*********
cls
a$="*********"
a=1
b=1
for i=1 to 5
print mid$(a$,a,b)
b=b+2
next
end
Unknown said…
how to print:
LLLLL
AAAA
PPP
EE
N
Unknown said…
how to print
N
E
P
A
L
Unknown said…
Wap to display
K
KA
KAT
KATH
KATHM
KATHMA
KATHMAN
KATHMAND
KATHMANDU
Bibash Pokhrel said…
Write a program to print the following pattern using SUB......END SUB.
1
2 4
3 6 9
4 8 12 16
5 10 15 20 25
Unknown said…
12345
234
3
How to do in qbasic
Unknown said…
1234
1234
1234
1234
Unknown said…
How to generate these patterns??

1) N
E
P
A
L

2) G
OGR
ROGRA
PROGRAM
Alysha Luitel said…
How to write program to return NEP from NEPAL
Unknown said…
How to print
N N
E E
P P
A A
L
A A
P P
E E
N N
Pratyush Sharma said…
For
NePaL
NePa
NeP
Ne
N
??Plz
Unknown said…
*******
*****
***
*

Popular posts from this blog

PROGRAM TO FIND SQUARE, CUBE, SQUARE ROOT AND CUBE ROOT OF GIVEN NUMBER

PALINDROME AND ARMSTRONG PROGRAMS

PROGRAM TO DISPLAY SUM, PRODUCT, DIFFERENCE AND PRODUCT OF TWO / THREE NUMBERS