Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

FIBONARIC SERIES

Private Sub Command1_Click() Dim x, g, n, i, sum As Integer n = Val(Text1.Text) x=0 y=1 Print x Print y For i = 3 To n sum = x + y Print sum x=y y = sum y = sum Next i End Sub

OUTPUT

FACTORIAL

Private Sub Command1_Click() Dim j, i as Integer i = CInt(Text1.Text) Label2.Caption = facts(i) End Sub Private Function facts(i) F=1 For j = 1 To i F=F*j facts = F Next j End Function

OUTPUT

MULITIPLICATION TABLE

Dim a, n, i As Integer Private Sub Command1_Click() n = Val(Text1.Text) For i = 1 To 10 a=n*i List1.AddItem n & "*" & i & " = " & a Next i End Sub

OUTPUT

CALCULATOR

Private Sub Command1_Click(index As Integer) Select Case index Dim x As Double Case 0 x = Val(Text1.Text) Text1.Text = Round((Sin(x * 3.14159265 / 180)), 4) Case 1 x = Val(Text1.Text) Text1.Text = Round((Cos(x * 3.14159265 / 180)), 4) Case 2 x = Val(Text1.Text) Text1.Text = Round((Tan(x * 3.14159265 / 180)), 4) End Select End Sub

OUTPUT

EMPLOYEE DETAILS

Private Sub Command1_Click() Call createConnection With rs .ActiveConnection = cnn .LockType = adLockOptimistic .CursorType = adOpenDynamic .Source = "Select*From emp" .Open End With rs.AddNew rs.Fields(0) = CInt(Text1.Text) rs.Fields(1) = Text2.Text rs.Fields(2) = Text3.Text rs.Fields(3) = Text4.Text rs.Fields(4) = Text5.Text rs.Update rs.Close Call clear Text1.SetFocus End Sub

OUTPUT

VISUAL BASIC LAB

You might also like