1. Study the following program and answer the given questions.
R$ = "CANDLELIGHTS"
FOR K=1 TO LEN(R$)
X$ = MID$(R$, K, 1)
IF UCASE$(X$)="A" THEN
N = N + 1
END IF
NEXT K
PRINT N
END
a.How many times does the loop execute?
b.List the library functions in above program.
2. Study the following program and answer the given questions.
CLS
I$ = “PRO”
L$ = “GRAM”
U$ = I$ + L$
PRINT U$
END
a.What will be the result of U$?
b.List the variables used in above program.
3. Study the following program and answer the given questions.
CLS
R$ = “FOOT”
P$ = “BALL”
G$ = R$ + P$
PRINT G$
END
a.Will the program runs if CLS is removed?
b.List the variables used in above program.
4. Study the following program and answer the given questions.
CLS
N$ = “ROSE”
O$ = “BUD”
K$ = N$ + O$
PRINT K$
END
a.N$ + O$ gives the result as “ROSEBUD”, what does it mean?
b.List the variables used in above program.
5. Study the following program and answer the given questions.
CLS
INPUT N
R = N MOD 2
IF R = 0 THEN
PRINT “EVEN NUMBER”
ELSE
PRINT “ODD NUMBER”
END IF
END
a.Name the variable used in above program.
b.What will be the value of R, if N = 10?
6. Study the following program and answer the given questions.
CLS
INPUT N
R = N MOD 2
IF R = 0 THEN
PRINT “EVEN NUMBER”
ELSE
PRINT “ODD NUMBER”
END IF
END
a.What will happen if CLS is removed from the program ?
b.What is the meaning of R= N MOD 2 ?
No comments:
Post a Comment