Saturday, December 28, 2019

1. Create a sequential data file “STUDENT.dat” to store name and marks obtain in English, Maths and Science for a few students.



Ans:

CLS
OPEN “STUDENT.DAT” FOR OUTPUT AS #1
DO
INPUT “Enter name”; N$
INPUT “Enter marks in English”; E
INPUT “Enter marks in Maths”; M
INPUT “Enter marks in Science”; S
WRITE #1, N$, E, M, S
INPUT “Do you want to continue(Y/N)”; CH$
LOOP WHILE UCASE$(CH$) =”Y”
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...