Answer to Question #47487 in Other Programming & Computer Science for irebami
Question #47487
There are _________ conditions under which a FOR-NEXT loop will not be executed at all
two
five
four
three
two
five
four
three
Expert's answer
Answer:
Some important points to know and remember when creating a FOR-TO-NEXT loop are:
· The loop begins with a FOR-TO statement and ends witha NEXT statement.
· The same running variable name must be used in theFOR-TO and NEXT statements.
· The running variable can appear in a statement insidethe loop, but its value cannot bechanged.
· The running variable will be incremented by 1 unless otherwise specified by a STEP clause.
· If the initial and final values of the runningvariable are equal, and the stepsize is nonzero, the loop will be executed once.
There are three conditions under which a loop will not be executed at all.
1. The initial and final values of the running variable are equal and the step size is zero.
2. The final value of the running variable is less than the original value, and the step size is positive.
3. The final value of the running variable is greater than the original value, and the step size isnegative.
So, answer is d)three.
Some important points to know and remember when creating a FOR-TO-NEXT loop are:
· The loop begins with a FOR-TO statement and ends witha NEXT statement.
· The same running variable name must be used in theFOR-TO and NEXT statements.
· The running variable can appear in a statement insidethe loop, but its value cannot bechanged.
· The running variable will be incremented by 1 unless otherwise specified by a STEP clause.
· If the initial and final values of the runningvariable are equal, and the stepsize is nonzero, the loop will be executed once.
There are three conditions under which a loop will not be executed at all.
1. The initial and final values of the running variable are equal and the step size is zero.
2. The final value of the running variable is less than the original value, and the step size is positive.
3. The final value of the running variable is greater than the original value, and the step size isnegative.
So, answer is d)three.
Need a fast expert's response?
Submit orderand get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments
Leave a comment