Friday, October 18, 2019

162. Qbasic sequential file handling to display all the records as well as total number of records stored in the file

162.Write a program in QBASIC to open a sequential data file “EMP.DAT”, which contains employees records: Name, address and phone number and display all the records as well as total number of records stored in the file. 
OPEN "LIB.TXT" FOR INPUT AS #1
CLS
WHILE NOT EOF (1)
  INPUT #1, A$, B$, C
PRINT A$, B$, C
D = D + 1
WEND
PRINT “TOTAL NUMBER OF RECORDS=”; D
CLOSE #1
END

1 comment: