English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Can u please explain why it is either !? thx in advance reallly need it >< and does anyone noe how to make a flow chart for the following
Option Explicit
Private sub cmdFor_click
Dim count as integer
cls
Print "count to 10 using a for loop"
For count =1 to 10
Print Count
Next count
End sub

NEXT ONE T_T

Private sub cmdReapeat_click
Dim count as integer
cls
count = 1
print "count to 10 using a repeat loop"
do
print count
count = count +1
loop until count =11
end sub
THX IN ADVANCe

2007-03-13 22:37:13 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

A for loop is a pre-test loop.
You could check by using
For count = 1 to 1 ...

A flowchart would be difficult to answer here, but try the following

http://www.agilemodeling.com/artifacts/flowChart.htm

2007-03-13 23:22:02 · answer #1 · answered by Math Guy 4 · 0 0

if u know C u could know why is either.

in for loop the processor works in 4 steps :

For count =1 to 10
Print Count
Next count


1 - intialize the variable(Count) to its default value(1)
(not repeatable)
2-test if this variable is <= maximamun value(10 included)
then go to step 3 else end
3-execute the code u want (Print Count)
4-increment the variable (Next count) and than go back to step 2

but in do loop the processor works line by line :

it consider the 'do' as a bookmark and begin to execute the under 'do' code until it reaches the 'loop until' statement and then make the test if OK the end else go next to the bookmark 'Do'

2007-03-14 06:24:55 · answer #2 · answered by 14Me14U 2 · 0 0

fedest.com, questions and answers