Computer Science, asked by shreya2295, 4 months ago

10 programs for loop​

Answers

Answered by keerthi577
0

Explanation:

In for loop we have exactly two semicolons, one after initialization and second after the condition. In this loop we can have more than one initialization or increment/decrement, separated using comma operator. But it can have only one condition.

The for loop is executed as follows:

It first evaluates the initialization code.

Then it checks the condition expression.

If it is true, it executes the for-loop body.

Then it evaluate the increment/decrement condition and again follows from step 2.

When the condition expression becomes false, it exits the loop.

Attachments:
Similar questions