What is the purpose of three expressions in FOR loop?
Please tell me the answer of this question? .........
as fast as you can...
Attachments:
Answers
Answered by
4
Answer:
for (initialization; condition; change){}
First the "initialization" is done.
Then the "condition" is checked.
If the condition is true, the "body" of the loop is executed. If not, control passes to the statement (if any) directly after the body of the loop.
After the body is executed, the "change" is done. This can be increment, decrement of the initialized variable(s) or something else.
Answered by
0
The purpose of three expressions in FOR loop
- A For loop has three components, similar to a While loop: the keyword For that initiates the loop, the condition being tested, and the keyword EndFor that ends the loop.
- Similar to the new Case Expressions and If Expressions, For Loop Expressions allow you to use a regular for Loop as a component of an expression. The for loop expression returns a Sequence of values as its output (implemented internally the same way as an Iterator would be).
- The three phrases that make up the fundamental for-loop are all optional; we are free to omit any or all of them. However, you must use both semicolons. The loop gets infinite and never terminates if the middle expression or test is left out.
- Loops are control structures that repeat a specific chunk of code until a certain condition is satisfied or a predetermined number of times. For.. next loops, do loops, and while loops are the three major types of loops in Visual Basic.
#SPJ2
Similar questions