Full width home advertisement

Grade 10 Revision

Post Page Advertisement [Top]

QBASIC OUTPUT DEBUG ANALYTICAL COLLECTION SET-9

SET-9

11. Write the output of the following program
DELARE SUB NUMBER()
CLS
CALL NUMBER
END
SUB NUMBER
N=3
C=1
WHILE C<=5
PRINT N
N=N*10+3
C=C+1
WEND
END SUB

Ans: Output
3
33
333
3333
33333

12. Rewrite the given program after correcting the bugs:
REM display Records of students From Data File
OPEN “STDREC.DAT” FOR INP AS #1
PRINT “ROLL”,”NAME”,”ADDRESS”,”CLASS”,”SECTION”
DO WHILE NOT EOF
INPUT #1,RN,N$,AD$,CL,S$
PRINT RN,N$,AD$,CL,S$
NEXT
CLOSE #1
END

Ans: Correct program

REM display Records of students From Data File
OPEN “STDREC.DAT” FOR INPUT AS #1
PRINT “ROLL”,”NAME”,”ADDRESS”,”CLASS”,”SECTION”
DO WHILE NOT EOF(1)
INPUT #1,RN,N$,AD$,CL,S$
PRINT RN,N$,AD$,CL,S$
LOOP
CLOSE #1
END

13. Study the following program and answer the given questions:
DECLARE SUB EXAM(N$)
CLS
INPUT “Enter word”;WO$
CALL EXAM(WO$)
END
SUB EXAM (N$)
FOR I = 1 TO LEN (N$)
PRINT RIGHT$(N$,I)
NEXT I
END SUB

a) Write the names of two built-in functions used in the above program.
Ans: The names of two built-in functions used in the above program are: LEN and RIGHT$.

b) List the real parameter in the program.
Ans: The real parameter in the program is WO$.

No comments:

Post a Comment

Bottom Ad [Post Page]