By Aaditya Shah
[Subscribe and Comment for more updates]
Saturday, December 28, 2019
7. Write a program to open a data file “SALARY.DAT” that contains Name, Address, Date of birth, and Telephone number of some employees. Display all those records whose date of birth is in current month.
Ans :-
CLS
OPEN “SALARY.DAT” FOR INPUT AS #1
WHILE NOT EOF(1)
INPUT #1, N$, A$, D$, , T
B$=LEFT$(D$, 2)
C=VAL(B$)
E$=LEFT$(DATE$, 2)
F=VAL(E$)
IF C=F THEN
PRINT N$, A$, D$, E, T
WEND
CLOSE #1
END
No comments:
Post a Comment