|
-
November 21st, 1999, 10:29 PM
#1
Please help! Need For Next loop for square!
I need a For Next loop that will calculate and display the square of the even numbers from 2 to 12.
kazooie21
-
November 22nd, 1999, 03:12 AM
#2
Re: Please help! Need For Next loop for square!
Dim i as Integer
for i = 2 to 12
If i Mod 2 = 0 then
Debug.print i & " " & Sqr(i)
End If
next i
-
November 22nd, 1999, 08:24 PM
#3
Re: Please help! Need For Next loop for square!
Since Mod is a relatively slow process I would use the step option instead of mod'ing each iteration.
Dim i as Integer
for i = 2 to 12 step 2
Debug.print i & " " & Sqr(i)
next i
Brewguru99
-
November 23rd, 1999, 02:32 AM
#4
Re: Please help! Need For Next loop for square!
although I doubt that speed is a major concern in this case :-)
, I think you solution is more elegant.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|