- Write a program to create a data file "STD.DAT" which stores Roll number, Name, Class and age of student. Age of students must be from 15 to 19. (Qbasic)
OPEN "STD.DAT" FOR OUTPUT AS #1
INPUT "Enter Roll number"; R
INPUT "Enter Name"; N$
INPUT "Enter Class"; C$
1:
INPUT "Enter Age (15 to 19)"; A
IF A >= 15 AND A <= 19 THEN
WRITE #1, R, N$, C$, A
ELSE
PRINT "Please enter correct age"
GOTO 1
END IF
CLOSE #1
END