Thursday, August 4, 2011

Qbasic (Display Recorded Data)

Write a QBASIC program to display data from a sequential data file "info.dat" with field name Id, Name, Address, Post and salary.
OPEN "info.dat" FOR INPUT AS #1
CLS
While not EOF(1)
PRINT "Id", "Name", "Address", "Post", "Salary"
INPUT #1, ID, N$,A$,P$,S
PRINT ID, N$,A$,P$, S
CLOSE #1
END

No comments:

Post a Comment