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



Thursday, March 7, 2019

Write a QBASIC Program to generate the series: 999,728,511,342,.......,upto 10th terms

Write a QBASIC Program to generate the series: 999,728,511,342,.......,upto 10th terms

CLS
a = 999
b = 271
c = 54
FOR i = 1 TO 10
    PRINT a
    a = a - b
    b = b - c
    c = c - 6
NEXT i
END