Sunday, 27 November 2016

Visual Basic 6.0 program to find the multiplication table of a given number


Interface












Program Code

Dim a As Integer

Private Sub cmdResult_Click()
Dim i As Integer
For i = 1 To 10
Print i & " * " & a & " = " & i * a
Next
Label2.Caption = a
End Sub

Private Sub Form_Load()
Form5.Show
a = InputBox("Enter the number")
End Sub

Visual Basic 6.0 program to find the largest of two numbers

Interface














Program Code
Private Sub cmdResult_Click()
Label4.FontBold = True
If (Val(Text1.Text)) > (Val(Text2.Text)) Then
Label4.Caption = "The largest number is " + Text1.Text
Else
Label4.Caption = "The largest number is " + Text2.Text
End If
End Sub

Private Sub Form_Load()
Text1.Text = InputBox("Enter the first number")
Text2.Text = InputBox("Enter the Second number")
End Sub

Visual Basic 6.0 program to check given number is odd or even

Interface

Program Code:
Private Sub cmdResult_Click()

Label3.Caption = ""
Label3.FontBold = True
If (Val(Text1.Text)) Mod 2 = 0 Then
Label3.Caption = "EVEN"
Else
Label3.Caption = "ODD"
End If
End Sub

Private Sub cmdClear_Click()
Text1.Text = ""
Label3.Caption = ""
Text1.SetFocus
End Sub

Private Sub Form_Load()
Form3.Show
Text1.Text = InputBox("ENTER THE NUMBER TO CHECK")
End Sub

Monday, 21 November 2016

Visual Basic 6.0 program to find the area of Rectangle, Circle and Triangle.

Interface


Program Code 

Private Sub cmdRectangle_Click()
Text3.Text = (Val(Text1.Text)) * (Val(Text2.Text))
End Sub

Private Sub cmdCircle_Click()
Text5.Text = (Val(Text4.Text)) * 3.14
End Sub

Private Sub cmdTriangle_Click()
Text9.Text = ((Val(Text6.Text)) + (Val(Text7.Text)) + (Val(Text8.Text))) / 2
End Sub

Saturday, 19 November 2016


Visual Basic 6.0 program to perform Arithmetic Operations

Interface
Program Code

Private Sub cmdADD_Click()
Text3.Text = (Val(Text1.Text)) + (Val(Text2.Text))
End Sub

Private Sub cmdSUB_Click()
Text3.Text = (Val(Text1.Text)) - (Val(Text2.Text))
End Sub

Private Sub cmdMULT_Click()
Text3.Text = (Val(Text1.Text)) * (Val(Text2.Text))
End Sub

Private Sub cmdDIV_Click()
Text3.Text = (Val(Text1.Text)) / (Val(Text2.Text))
End Sub

VB Practical Questions


WELCOME TO MY CLASS  ROOMYou can find the study materials here,I hope this helps!