Friday, October 18, 2019

159. Qbasic sequential file handling to read all the records and print those with address “NEPAL” and age >15

159.A data file “INFO.DAT” has numerous records in it with name, address age, and telephone numbers in it. Write a program to read all the records and print those with address “NEPAL” and age >15
OPEN "INFO.DAT" FOR INPUT AS #1
CLS
WHILE NOT EOF (1)
  INPUT #1, A$, B$, C, D
    IF UCASE$(B$) = “NEPAL” AND C >15 THEN PRINT A$, B$, C, D
WEND
CLOSE #1
END

No comments:

Post a Comment