QBASIC Programming
WAPs to display :
1. K
KA
KAT
KATH
KATHM
KATHMA
KATHMAN
KATHMAND
KATHMANDU
=>CLS
A$ = "KATHMANDU"
FOR I = 1 TO LEN(A$)
PRINT LEFT$ (A$, I)
NEXT I
END
2. U
1. K
KA
KAT
KATH
KATHM
KATHMA
KATHMAN
KATHMAND
KATHMANDU
=>CLS
A$ = "KATHMANDU"
FOR I = 1 TO LEN(A$)
PRINT LEFT$ (A$, I)
NEXT I
END
2. U
DU
NDU
ANDU
MANDU
HMANDU
THMANDU
ATHMANDU
KATHMANDU
=>CLS
A$ =" KATHMANDU "
FOR I = 1 TO LEN(A$)
PRINT RIGHT$(A$, I)
NEXT I
END
3.KATHMANDU
KATHMAND
KATHMAN
KATHMA
KATHM
KATH
KAT
KA
K
=>CLS
A$ =" KATHMANDU "
FOR I = LEN(A$) TO 1 STEP - 1
PRINT LEFT$(A$, I)
NEXT I
END
4.KATHMANDU
ATHMANDU
THMANDU
HMANDU
MANDU
ANDU
NDU
DU
U
=>CLS
A$ =" KATHMANDU "
FOR I = LEN(A$) TO 1 STEP-1
PRINT RIGHT$(A$, I)
NEXT I
END
5. U
DU
NDU
ANDU
MANDU
HMANDU
THMANDU
ATHMANDU
KATHMANDU
=>CLS
A$ =" KATHMANDU "
A = 9
FOR I = 1 TO LEN(A$)
PRINT TAB(A) ; RIGHT$(A$, I)
A = A - 1
NEXT I
END
6. K
KA
KAT
KATH
KATHM
KATHMA
KATHMAN
KATHMAND
KATHMANDU
=>CLS
A$ =" KATHMANDU "
A = 9
FOR I = 1 TO LEN(A$)
PRINT TAB(A); LEFT$(A$, I)
A = A-1
NEXT I
END
7.KATHMANDU
ATHMANDU
THMANDU
HMANDU
MANDU
ANDU
NDU
DU
U
=>CLS
A$ =" KATHMANDU "
A = 1
FOR I = LEN(A$) TO 1 STEP -1
PRINT TAB(A) ; RIGHT$(A$, I)
A = A + 1
NEXT I
END
8.KATHMANDU
KATHMAND
KATHMAN
KATHMA
KATHM
KATH
KAT
KA
K
=>CLS
A$ = "KATHMANDU"
A = 1
FOR I = LEN(A$) TO 1 STEP - 1
PRINT TAB(A) ; LEFT$(A$, I)
A = A + 1
NEXT I
END
9.K
A
T
H
M
A
N
D
U
=>CLS
A$ = "KATHMANDU"
FOR I = 1 TO LEN (A$)
PRINT MID$(A$, I, 1)
NEXT I
END
10.U
D
N
A
M
H
T
A
K
=>CLS
A$ = "KATHMANDU"
FOR I = LEN(A$) TO 1 STEP - 1
PRINT MID$(A$, I, 1)
NEXT I
END
11.K
A
T
H
M
A
N
D
U
=> CLS
A $ = "KATHMANDU"
A=1
FOR I = 1 TO LEN (A $)
PRINT TAB (A); MID$(A $, I, 1)
A = A + 1
NEXT I
END
12.U
D
N
A
M
H
T
A
K
=> CLS
A$ = "KATHMANDU"
A=1
FOR I = LEN (A$, I, 1) TO 1 STEP -1
PRINT TAB (A); MID$(A$, I, 1)
A = A + 1
NEXT I
END
13. K
A
T
H
M
A
N
D
U
=> CLS
A$ = "KATHMANDU"
A= 9
FOR I = 1 TO LEN (A$)
PRINT TAB (A); MID$(A$, I, 1)
A = A - 1
NEXT I
END
14. U
D
N
A
M
H
T
A
K
=> CLS
A$ = "KATHMANDU"
A = 9
FOR I = LEN (A$, I, 1) TO 1 STEP -1
PRINT TAB (A); MID$(A$, I, 1)
A = A - 1
NEXT I
END
15.*****
****
***
**
*
=> CLS
A$ = "*****"
FOR I = LEN (A$) TO 1 STEP- 1
PRINT LEFT$(A$, I)
NEXT I
END
16. *****
****
***
**
*
=> CLS
A$="*****"
A = 5
FOR I = LEN (A$) TO 1 STEP- 1
PRINT TAB (A); LEFT$(A$, I)
A = A - 1
NEXT I
END
17.*
**
***
****
*****
=> CLS
A$ = "*****"
FOR I = 1 TO LEN (A$)
PRINT LEFT$(A$, I)
NEXT I
END
18. *
**
***
****
*****
=> CLS
A$ = "*****"
A = 5
FOR I = 1 TO LEN (A$)
PRINT TAB (A); LEFT$ (A$, I)
A = A - 1
NEXT I
END
19.*
**
***
****
*****
*
**
***
****
*****
*
*
*
*
*
=> CLS
A$ = "*****"
FOR I = 1 TO LEN (A$)
PRINT LEFT$(A$, I)
NEXT I
FOR J = 1 TO LEN (A$)
PRINT LEFT$(A$, J)
NEXT J
FOR K = 1 TO LEN (A$)
PRINT MID$(A$, K, 1)
NEXT K
END
20.*
***
*****
*******
*********
=>CLS
A$ = "*********"
FOR I = 1 TO LEN (A$) STEP 2
PRINT LEFT$(A$, I)
NEXT I
END
21.*********
*******
*****
***
*
=> CLS
A$ = "*********"
FOR I = LEN (A$) TO 1 STEP- 1
PRINT LEFT$(A$, I)
NEXT I
END
22.KATHMANDU
ATHMAND
THMAN
HMA
M
=> CLS
A$ = "KATHMANDU"
A = 1
FOR I = LEN (A$) TO 1 STEP -2
PRINT MID$(A$, A, I)
A = A + 1
NEXT I
END
22.M
HMA
THMAN
ATHMAND
KATHMANDU
=> CLS
A$ = "KATHMANDU"
A = 5
FOR I = 1 TO LEN (A$) STEP 2
PRINT MID$(A$, A, I)
A = A- 1
NEXT I
END
24. M
HMA
THMAN
ATHMAND
KATHMANDU
=> CLS
A$ = "KATHMANDU"
A = 5
FOR I = 1 TO LEN (A$) STEP 2
PRINT TAB(A); MID$ (A$, A, I)
A = A- 1
NEXT I
END
25. KATHMANDU
ATHMAND
THMAN
HMA
M
=> CLS
A$ = "KATHMANDU"
A = 1
FOR I = LEN(A$) TO 1 STEP- 2
PRINT TAB (A); MID$(A$, A, I)
A = A + 1
NEXT I
END
26.*KATHMANDU*
*KATHMAND*
*KATHMAN*
*KATHMA*
*KATHM*
*KATH*
*KAT*
*KA*
*K*
=> CLS
A$ = "KATHMANDU"
FOR I = LEN (A$) TO 1 STEP- 1
PRINT *; LEFT$(A$, I); *
NEXT I
END
Comments
Post a Comment