What will be displayed in the label when the user clicks the

What will be displayed in the label when the user clicks the button?

Private Sub btnSubmit_Click(ByVAl Sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

    Dim num1 As Integer = 3

    Dim num2 As Integer = 2

    Dim num3 As Integer

    num3 = myProc(num1, num2)

    lblResult.Text = Convert.ToString(num3)

End Sub

Function myProc(ByVal num1 Par As Integer, ByVal num2 Par As Integer) As Integer

Return num1 Par * num2 Par

End Function

Solution

In this case according to the above sample code after the user clicks the button it shows the result of the function in the form of string i.e. the result of num1 par* num2 par.

Here in the above code snippet the functionality goes like this,

First the first statement is for the button functionality which what it has to do after click..

Then after there are 3 declaration and initialisation statements for num1, num2 ,num3.

Then next statement is to convert the result into the string format fron the number format.

After that function definition comes with the function declaration with the 2 input arguments num1 and num2.

After that the next statement is multiplying this num1 and num2 and the value will be returned.

What will be displayed in the label when the user clicks the button? Private Sub btnSubmit_Click(ByVAl Sender As System.Object, ByVal e As System.EventArgs) Han

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site