The form interface in Visual Basic is shown here that adds the two numbers entered by the user. Which of the following codes is correct for adding two numbers? |
Assume the Name property of the controls as: |
(b) First Number TextBox : Text1 |
(c) Second Number TextBox : Text2 |
(d) Answer TextBox : Text3 |
(e) add Command Button : cmdAdd |
A)
Private Sub cmdAdd_Click()
Text3.Text=Val(Text1.Text)+Val(Text2.Text)
End Sub
B)
Private Sub cmdAdd_Click()
Text1 .Text=Val (Text1 .Text) +Val (Text3. Text)
End Sub
C)
Private Sub cmdAdd_Click()
Text1.Text=Val(Text2.Text), Add, Val(Text3.Text)
End Sub
D) Both [B] and [C]
Correct Answer: A
You need to login to perform this action.
You will be redirected in
3 sec