Friday, October 18, 2019

169. Qbasic sequential file handling to display the records whose address begins with ‘S’ or ‘D’

169.A sequential data file’post.dat’ has few records related to name, address, salary.WAP to display the records whose address begins with ‘S’ or ‘D’
OPEN "POST.DAT" FOR INPUT AS #1
CLS
WHILE NOT EOF (1)
  INPUT #1, N$, P$, S
A$ = UCASE$(LEFT$(N$,1))   
IF A$ = “S” OR A$ = “D” THEN PRINT N$, P$, S
WEND
CLOSE #1
END

No comments:

Post a Comment