QBasic programs collection-Especially for SEE (Grade-10)
QBasic program to know the output of program using dry run table- to print the characters from given string
DECLARE SUB CHEMISTRY()
Cls
Call CHEMISTRY
End
Sub CHEMISTRY ()
Let A$ = "VIDEO"
Let B = Len(A$)
For I = 1 To 4
Print Mid$(A$, I, B)
Next I
End Sub
DRY RUN table with output is given below
A$ |
B=LEN(A$)=5 |
I= 1 TO 4 |
MID$(A$,I,B) |
VIDEO |
B=5 |
I=1 |
MID$(A$,I,B)=VIDEO |
|
B=5 |
I=2 |
MID$(A$,I,B)=IDEO |
|
B=5 |
I=3 |
MID$(A$,I,B)=DEO |
|
B=5 |
I=4 |
MID$(A$,I,B)=EO |
output:
VIDEO
IDEO
DEO
No comments:
Post a Comment