-->

Monday, June 9, 2025

Qbasic program to get output using dry run table | SEE computer science programming guide in Qbasic - to know the output

 


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

EO

Qbasic program to get output using dry run table | SEE computer science programming guide in Qbasic - to know the output

 

QBasic programs collection-Especially for SEE (Grade-10)


QBasic program to know the output of program using dry run table- to extract characters and print them


DECLARE FUNCTION OUTPUTT$(W$)

Cls

W$ = "CRIMES"

Print OUTPUTT$(W$)

End

Function OUTPUTT$ (W$)

    For M = Len(W$) To 1 Step -2

        M$ = M$ + Mid$(W$, M, 1)

    Next M

    OUTPUTT$ = M$

End Function


DRYRUN table for above program is given below

W$

M=6 TO 1 STEP-2

M$=M$+MID$(W$,M,1)

OUTPUTTT$

 

 

CRIMES

M=6

M$=S

 

 

 

 

M=4

M$=S+M=SM

 

 

 

 

M=2

M$=SM+R=SMR

SMR

 

 

Output:-

SMR

Qbasic program to get output using dry run table | SEE computer science programming guide in Qbasic - to display characters

 


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 RESULT(A$)

Cls

A$ = "KATHMANDU"

Call RESULT(A$)

End

Sub RESULT (A$)

    For C = 1 To Len(A$) Step 2

        X$ = Mid$(A$, C, 1)

        Print X$;

    Next C

End Sub


DRYRUN for above program

A$

C=1 TO 9 STEP 2

X$=MID$(A$,C,1)

PRINT X$;

 

 

KATHMANDU

C=1

X$=K

K

 

 

 

C=3

X$=T

T

 

 

 

C=5

X$=M

M

 

 

 

C=7

X$=N

N

 

 

 

C=9

X$=U

U

 

 

Output:-

KTMNU