Friday, October 18, 2019

171. Qbasic sequential file handling to display the records of all those who were born between 1971 to 1999.

171.A sequential data file “Record.dat” has few records related to name, address, post and DOB(mm/dd/yyyy). WAP to display the records of all those who were born between 1971 to 1999.

OPEN "RECORD.dat" FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
    INPUT #1, n$, a$, p$, d$
    d$ = RIGHT$(d$, 4)
    c = VAL(b$)
        IF c >= 1971 and c<=1999 THEN PRINT n$, d$, a$
WEND
CLOSE #1
END

No comments:

Post a Comment