Sunday, March 17, 2019

A sequential data file "birth.dat" contains number of records having field name as Name, DOB and address. Write a program to display the record whose date of birth is the current month.

A sequential data file "birth.dat" contains number of records having field name as Name, DOB and address. Write a program to display the record whose date of birth is the current month.

OPEN "birth.dat" FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
    INPUT #1, n$, d$, a$
    b$ = LEFT$(DATE$, 2)
    c = VAL(b$)
    e$ = LEFT$(d$, 2)
    f = VAL(e$)
    IF c = f THEN PRINT n$, d$, a$
WEND
CLOSE #1
END



No comments:

Post a Comment