To add 2 numbers
- Refer the same program in Pass By Value Method Add 2 numbers(Pass by Value method) ,and in Pass By Reference Method Declare a function(Pass by reference) also.
(B) Property(Controls Used) :
- 3 Labels with Captions Enter First Number , Enter Second Number and Answer.
- 3 TextBoxes with Name Text1, Text2 and Text3 , and all of the TextProperty is Blank
- One Command Button with Name-Command1 , and Caption-Add
(C) Attaching Code to the Object :
Private Sub Command1_Click() Text3.Text = Val(Text1.Text) + Val(Text2.Text) End Sub |
(D) Output :
(E) Errors :
If found any errors while running your VB program, or want to put your comment about any program , please click Comment section , to post.
- ====================================================================
No comments:
Post a Comment