Practical No 03 Gad 22034
Practical No 03 Gad 22034
Practical No 03 Gad 22034
Practical No: 03
Module Module1
Dim i, j, r As Integer
Sub Main()
Console.WriteLine("Enter First Value=")
i = Console.ReadLine()
Console.WriteLine("Enter Second Value=")
j = Console.ReadLine()
Console.ReadLine()
MsgBox("Addition =" & (i + j))
MsgBox("Substraction =" & (i - j))
MsgBox("Multiplication =" & (i * j))
MsgBox("Division =" & (i / j))
End Sub
End Module
Results (Output of the Program)
Enter First Value=
10
Enter Second Value=
5
---------------------------
MessageBoxPractical3
---------------------------
Addition =15
---------------------------
OK
---------------------------
It has prototype –
DialogResult Show(String text, String caption, MessageBoxButtons buttons,
MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
This method is static and doesn’t required and object reference. The parameters and return
values are explained below –
Parameters
1. text As String - The text to display in the message box.
2. caption As String - The text to display in the title bar of the message box.
3. buttons As MessageBoxButtons - One of the MessageBoxButtons values that
specifies which buttons to display in the message box.
4. icon As MessageBoxIcon - One of the MessageBoxIcon values that specifies which
icon to display in the message box.
5. defaultButton As MessageBoxDefaultButton - One of the
MessageBoxDefaultButton values that specifies the default button for the message
box.
Returns
DialogResult - One of the DialogResult values.
XIV. Exercise
1. Implement the program to generate result of any arithmetic operation using
MessageBox().
Addition=60
OK
End Sub
End Class
Output:
Inputbox_Msgbox
Addition = 68
OK