Computer Science, asked by Laukik7171, 9 months ago

When for loop will be executed infinitely?​

Answers

Answered by missNAV143957
7

Answer:

here is ur answer

Explanation:

The loop that does not stop executing and processes the statements number of times is called as an infinite loop. An infinite loop is also called as an "Endless loop." Following are some characteristics of an infinite loop: 1. No termination condition is specified.

Answered by AskewTronics
1

A "for-loop" will execute infinitely when the condition of the "for loop" will not become false in any iteration of the loop body.

Explanation:

  • A loop is introduced in the programming language to repeat some line in a finite amount of time and the amount of time is defined in the condition of the loop.
  • A loop is of basic three-types while loop, for loop and do-while loop. In every loop, there is a condition check and the loop stops to executes its body when the condition fails.
  • When the condition of for loop is true in every case then the loop body does not stop its execution at any time and the loop goes into an infinite amount of time.
  • To run the 'for loop' in a finite amount of time, a user needs to change the value of a condition variable in every iteration of the loop so the loop condition will false at any time the loop stops its working.
  • The above question asked that when a loop will run in an infinite amount of time then the answer is when its condition becomes true in every iteration of the loop which is described above.

Learn More:

  • Loop: https://brainly.in/question/2359999
Similar questions