VBI 72.PNG

Private Sub Command1_Click()
    Dim i, rn, tm As Integer
    Open "Pass.dat" For Output As #1
    Open "Fail.dat" For Output As #2
    For i = 1 To 10
        rn = InputBox("Enter Roll No ", "Integer")
        tm = InputBox("Enter Total Marks ", "Integer")
        If tm >= 300 Then
            Write #1, rn, tm
        Else
            Write #2, rn, tm
        End If
    Next i
    Close #1, #2
End Sub

VBO 72

Advertisements