Got a problem in my loop and I'm not certain how to code it.
I am not supposed to use x ^ y and I have to use multiplication in a loop to
do this.
Here's what I have...
If rdoExp.Checked = True Then
If num2 = 0 Then
lblResult2.Text = "Cannot Raise to the power of Zero!"
Else
Dim x As Integer
Dim old_ans As Double
' Loop the Multiplication x Times
If Val(txtNum2.Text) = 2 Then
lblResult2.Text = Str(num1) + " ^" + Str(num2) + " =" + Str(num1 *
num1)
Else
For x = 1 To num2
result = (result * num2) + old_ans
Next
'Dump The Result into the Result Area of the Form
lblResult2.Text = Str(num1) + " ^" + Str(num2) + " =" + Str(result)
End If
'Reset result amount
result = 0
old_ans = 0
End If
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004