Home  |  IT Zone  | Practice ZoneTips / Tricks  |  Did You Know  |  Inspirational  |  Health  |  Insurance  |  Universities  |  Forex  |  Mathematics  |  Illusions  |  Children Day Quotes  |  Be Aware  |  Articles  | Funny Pics | Entertainment | Songs | Simple Joys of Life |

A program to create a data file STD.DAT which stores Roll number, Name, Class and age of student. (Qbasic)

  • Write a program to create a data file "STD.DAT" which stores Roll number, Name, Class and age of student. Age of students must be from 15 to 19. (Qbasic)
CLS
OPEN "STD.DAT" FOR OUTPUT AS #1
INPUT "Enter Roll number"; R
INPUT "Enter Name"; N$
INPUT "Enter Class"; C$
1:
INPUT "Enter Age (15 to 19)"; A
IF A >= 15 AND A <= 19 THEN
    WRITE #1, R, N$, C$, A
ELSE
    PRINT "Please enter correct age"
    GOTO 1
END IF
CLOSE #1
END

Share :

X
Back To Top

facebook main

Powered by Blogger.