To Write A Program in VB To Create A Calculator
To Write A Program in VB To Create A Calculator
Dim A As Integer
Dim B As Integer
Dim R As Integer
A = Val(Text1.Text)
B = Val(Text2.Text)
Text3.Text = A + B
End Sub
To write a program in VB to subtract two numbers
Dim A As Integer
Dim B As Integer
Dim R As Integer
A = Val(Text1.Text)
B = Val(Text2.Text)
Text3.Text = A - B
End Sub
To write a program in VB to multiply two numbers
Dim A As Integer
Dim B As Integer
Dim R As Integer
A = Val(Text1.Text)
B = Val(Text2.Text)
Text3.Text = A * B
End Sub
To write a program in VB to divide to numbers
Dim A As Integer
Dim B As Integer
Dim R As Integer
A = Val(Text1.Text)
B = Val(Text2.Text)
Text3.Text = A / B
End Sub
To write a program in VB to take mod of two numbers
Dim A As Integer
Dim B As Integer
Dim R As Integer
A = Val(Text1.Text)
B = Val(Text2.Text)
Text3.Text = A Mod B
End Sub
To write a program in VB to take square root of two
numbers
Private Sub Command6_Click()
Dim A As Integer
Dim B As Integer
Dim R As Integer
A = Val(Text1.Text)
Text3.Text = Sqr(A)
End Sub
To write a program in VB to clear the screen
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
End
End Sub
To write a program in VB to make comparison between two
numbers.
COMPARISON BETWEEN TWO NUMBERS
Dim B As Integer
A = Val(Text1.Text)
B = Val(Text2.Text)
If (A >= B) Then
Else
End If
End Sub
Private Sub Command2_Click()
Dim A As Integer
Dim B As Integer
A = Val(Text1.Text)
B = Val(Text2.Text)
If (A <= B) Then
Else
End If
End Sub
Private Sub Command5_Click()
Dim A As Integer
Dim B As Integer
If (A = B) Then
Else
End If
End Sub
TO CLEAR THE SCREEN AND TO EXIT
Text1.Text = ""
Text2.Text = ""
End Sub
TO EXIT
End
End Sub
Dim A As Integer
Dim B As Integer
Dim C As Integer
A = Val(Text1.Text)
B = Val(Text2.Text)
C = Val(Text3.Text)
Else
End If
End Sub
Dim A As Integer
Dim B As Integer
Dim C As Integer
A = Val(Text1.Text)
B = Val(Text2.Text)
C = Val(Text3.Text)
Else
End If
End Sub
TO CLEAR
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
TO EXIT
End
End Sub
TO CREATE A LOGIN BOX
TO CREATE A REGISTRATION FORM
COUNTING
Private Sub Command1_Click()
For i = 1 To 10 Step 1
Print i
Next i
End Sub
TO EXIT
End
End Sub
TO ADD TABLE OF TWO
Private Sub Command1_Click()
For i = 2 To 20 Step 2
Print i
Next i
End Sub
TO EXIT
End
End Sub
Private Sub Command1_Click()
Dim N As Integer
N = Val(Text1.Text)
For i = 1 To N Step 1
Print i
Next i
End Sub
Private Sub Command2_Click()
Text1.Text = ""
End Sub
End
End Sub
Private Sub Command1_Click()
Dim N As Integer
N = Val(Text1.Text)
For i = N To N * 10 Step N
Print i
Next i
End Sub
TO CLEAR AND TO EXIT
Text1.Text = ""
End Sub
End
End Sub
TO ORDER THE ALPHABETS
ARRANGE ALPHABETS IN SERIAL ORDER
For i = 65 To 69 Step 1
For j = 65 To i Step 1
Print Chr(i);
Next j
Next i
END SUB
TO ARRANGE ALPHABETS IN REVERSE ORDER
For i = 69 To 65 Step -1
For j = 65 To i Step 1
Print Chr(i);
Next j
Next i
End Sub
TO EXIT
End
End SuB
Private Sub Command1_Click()
For i = 65 To 69 Step 1
For J = 65 To i Step 1
Print Chr(J);
Next J
Next i
End Sub
Private Sub Command2_Click()
For i = 69 To 65 Step -1
For J = 65 To i Step 1
Print Chr(J);
Next J
Next i
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Command1_Click()
For i = 1 To 5 Step 1
For J = 1 To i Step 1
Print "*";
Next J
Next i
End Sub
Private Sub Command2_Click()
For i = 5 To 1 Step -1
For J = 1 To i Step 1
Print "*";
Next J
Next i
End Sub
TO EXIT
End
End Sub
SELECT EVEN OR ODD NUMBERS
Private Sub Command1_Click()
Dim N As Integer
N = Val(Text1.Text)
If (N Mod 2 = 0) Then
Else
End If
End Sub
TO CLEAR
Text1.Text = ""
End Sub
TO END
End
End Sub
Private Sub Command1_Click()
Dim N As Integer
N = Val(Text1.Text)
Else
End If
End Sub
TO CLEAR
Text1.Text = ""
End Sub
TO EXIT
End
End Sub