dear all i am sending a code
i want a code which will multiple three numbers given in three
text boxes without using multiplication operator.
and show the answer in the fourth text box

Private Sub cmdbutton_Click()

Dim BOX1 As Integer 'Declaring variables
Dim BOX2 As Integer
Dim BOX3 As Integer
Dim result As Integer
Dim i As Integer

BOX1 = txt1.Text 'Assigning values of text boxes to the variables
BOX2 = txt2.Text
BOX3 = txt3.Text


For i = 1 To BOX3 ' Using For Loop
result = result + BOX2 + BOX3
NEXT
txtresult.Text = result 'Displaying the result in text box
End Sub

PLEASE TELL ME WHICH LINE CODE SHOULD BE USED INSTEAD OF THIS ONE


"result = result + BOX2 + BOX3"


WAITING FOR UR REPLY
BYE

people plz reply meeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
PLZ FOR GOD SAKE
I M CRYING

I am not sure if you can do it in a single loop. If you want to use 2 loops, you can try this code

Dim mNum1 As Integer
Dim mNum2 As Integer
Dim mNum3 As Integer
Dim mMidResult As Long
Dim mFinalResult As Long
Dim i As Integer

mNum1 = Val(Text1.Text)
mNum2 = Val(Text2.Text)
mNum3 = Val(Text3.Text)

For i = 1 To mNum2
    mMidResult = mMidResult + mNum1
Next
For i = 1 To mNum3
    mFinalResult = mFinalResult + mMidResult
Next
Text4.Text = mFinalResult
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.