Saturday, December 28, 2019

12.A data file named “INFO.dat” contains Name of Staff,, Post and Basic Salary. Write a program to count and display total number of records in a file :-


Ans :


CLS
OPEN “INFO.DAT” FOR INPUT AS #1
C=0
WHILE NOT EOF(1)
INPUT #1, N$, D$, P$, S
C=C+1
WEND
PRINT “Total number of records=”; C
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...