Saturday, December 28, 2019

2.Write a program to open a data file “STUDENT.DAT” that contains Name, Address, Telephone number and Parent’s Name of some students. Now display all those records whose Address is “LALITPUR”.


Ans:

CLS
OPEN “STUDENT.DAT” FOR INPUT AS #1
WHILE NOT EOF(1)
INPUT #1, N$, A$, T#, PN$
IF UCASE$(A$) =”LALITPUR” THEN PRINT N$, A$, T#, PN$
WEND
CLOSE #1
END

No comments:

Post a Comment

File Handling

Introduction:- Data are used in all the programs for retrieving information. In QBASIC you can store data in a separate file called a da...